diff options
author | Jason Merrill <jason@redhat.com> | 2015-04-23 11:55:11 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-04-23 11:55:11 -0400 |
commit | 6c28362134af5aa01326e4fc3d38753b7fd42eba (patch) | |
tree | bf7203a626a25ae70923bb315a48b75b1bde60e7 /gcc | |
parent | 2667715244097b329c9725a7fcbffcb2bce800be (diff) | |
download | gcc-6c28362134af5aa01326e4fc3d38753b7fd42eba.zip gcc-6c28362134af5aa01326e4fc3d38753b7fd42eba.tar.gz gcc-6c28362134af5aa01326e4fc3d38753b7fd42eba.tar.bz2 |
re PR c++/65646 (ICE in invalid syntax)
PR c++/65646
* pt.c (check_explicit_specialization): Don't
SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template
headers.
* decl.c (grokvardecl): Revert earlier fix.
From-SVN: r222376
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 91c3890..a463f66 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2015-04-23 Jason Merrill <jason@redhat.com> + + PR c++/65646 + * pt.c (check_explicit_specialization): Don't + SET_DECL_TEMPLATE_SPECIALIZATION for a variable with no template + headers. + * decl.c (grokvardecl): Revert earlier fix. + 2015-04-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/65801 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 29d6e73..6ec1579 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8210,9 +8210,7 @@ grokvardecl (tree type, DECL_INTERFACE_KNOWN (decl) = 1; // Handle explicit specializations and instantiations of variable templates. - if (orig_declarator - /* For GCC 5 fix 65646 this way. */ - && current_tmpl_spec_kind (template_count) != tsk_none) + if (orig_declarator) decl = check_explicit_specialization (orig_declarator, decl, template_count, 0); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 91e56a5..f9a5c3b 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2424,7 +2424,7 @@ check_explicit_specialization (tree declarator, switch (tsk) { case tsk_none: - if (processing_specialization) + if (processing_specialization && TREE_CODE (decl) != VAR_DECL) { specialization = 1; SET_DECL_TEMPLATE_SPECIALIZATION (decl); |