re PR c++/65646 (ICE in invalid syntax)
authorJason Merrill <jason@redhat.com>
Thu, 23 Apr 2015 15:55:11 +0000 (11:55 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 23 Apr 2015 15:55:11 +0000 (11:55 -0400)
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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/pt.c

index 91c389052c6f88e6fe263652b6db89d596f39722..a463f66c18e02a27ec4c4804094dfda0c3444463 100644 (file)
@@ -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
index 29d6e73ca31ff5ef9a6630c7a4c39e9e6ad4ea71..6ec157912af9771ab11319fd978d58ca4bd139d1 100644 (file)
@@ -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);
 
index 91e56a55af9b2d31d1ed74c1c27e976059e32513..f9a5c3b70c5bf0840039c6de781f5db995736548 100644 (file)
@@ -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);