Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
befd067c
Commit
befd067c
authored
Dec 11, 2012
by
Jason Merrill
Committed by
Jason Merrill
Dec 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* pt.c (maybe_process_partial_specialization): Handle aliases first.
From-SVN: r194407
parent
d0608e59
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
gcc/cp/ChangeLog
+4
-0
gcc/cp/pt.c
+13
-17
gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C
+2
-2
No files found.
gcc/cp/ChangeLog
View file @
befd067c
2012-12-11 Jason Merrill <jason@redhat.com>
* pt.c (maybe_process_partial_specialization): Handle aliases first.
2012-12-11 Jakub Jelinek <jakub@redhat.com>
PR c++/55619
...
...
gcc/cp/pt.c
View file @
befd067c
...
...
@@ -812,13 +812,17 @@ maybe_process_partial_specialization (tree type)
context
=
TYPE_CONTEXT
(
type
);
if
((
CLASS_TYPE_P
(
type
)
&&
CLASSTYPE_USE_TEMPLATE
(
type
))
/* Consider non-class instantiations of alias templates as
well. */
||
(
TYPE_P
(
type
)
&&
TYPE_TEMPLATE_INFO
(
type
)
&&
DECL_LANG_SPECIFIC
(
TYPE_NAME
(
type
))
&&
DECL_USE_TEMPLATE
(
TYPE_NAME
(
type
))))
if
(
TYPE_ALIAS_P
(
type
))
{
if
(
TYPE_TEMPLATE_INFO
(
type
)
&&
DECL_ALIAS_TEMPLATE_P
(
TYPE_TI_TEMPLATE
(
type
)))
error
(
"specialization of alias template %qD"
,
TYPE_TI_TEMPLATE
(
type
));
else
error
(
"explicit specialization of non-template %qT"
,
type
);
return
error_mark_node
;
}
else
if
(
CLASS_TYPE_P
(
type
)
&&
CLASSTYPE_USE_TEMPLATE
(
type
))
{
/* This is for ordinary explicit specialization and partial
specialization of a template class such as:
...
...
@@ -831,8 +835,7 @@ maybe_process_partial_specialization (tree type)
Make sure that `C<int>' and `C<T*>' are implicit instantiations. */
if
(
CLASS_TYPE_P
(
type
)
&&
CLASSTYPE_IMPLICIT_INSTANTIATION
(
type
)
if
(
CLASSTYPE_IMPLICIT_INSTANTIATION
(
type
)
&&
!
COMPLETE_TYPE_P
(
type
))
{
check_specialization_namespace
(
CLASSTYPE_TI_TEMPLATE
(
type
));
...
...
@@ -845,16 +848,9 @@ maybe_process_partial_specialization (tree type)
return
error_mark_node
;
}
}
else
if
(
CLASS_TYPE_P
(
type
)
&&
CLASSTYPE_TEMPLATE_INSTANTIATION
(
type
))
else
if
(
CLASSTYPE_TEMPLATE_INSTANTIATION
(
type
))
error
(
"specialization of %qT after instantiation"
,
type
);
if
(
DECL_ALIAS_TEMPLATE_P
(
TYPE_TI_TEMPLATE
(
type
)))
{
error
(
"partial specialization of alias template %qD"
,
TYPE_TI_TEMPLATE
(
type
));
return
error_mark_node
;
}
}
else
if
(
CLASS_TYPE_P
(
type
)
&&
!
CLASSTYPE_USE_TEMPLATE
(
type
)
...
...
gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C
View file @
befd067c
...
...
@@ -5,10 +5,10 @@
template
<
class
T
,
class
U
>
struct
A0
{};
template
<
class
T
,
class
U
>
using
AA0
=
A0
<
T
,
U
>
;
template
<
class
T
>
struct
AA0
<
int
,
T
>
{};
// { dg-error "
partial
specialization" }
template
<
class
T
>
struct
AA0
<
int
,
T
>
{};
// { dg-error "specialization" }
template
<
class
U
>
using
Ptr
=
U
*
;
template
<
class
U
>
struct
Ptr
<
U
*>
{};
// { dg-error "
partial
specialization" }
template
<
class
U
>
struct
Ptr
<
U
*>
{};
// { dg-error "specialization" }
struct
A
{
using
A
=
int
;
//{ dg-error "nested|has|same name as|class|in which|declared" }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment