gcc/cp/
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Mar 2009 14:56:45 +0000 (14:56 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Mar 2009 14:56:45 +0000 (14:56 +0000)
2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/39425
* parser.c (cp_parser_explicit_specialization): Don't skip the
rest of the specialization when begin_specialization returns
false.

gcc/testsuite/

2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>

PR c++/39425
* g++.dg/template/pr39425.C: New.

* g++.dg/template/spec33.C: Updated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144932 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pr39425.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/spec33.C

index 1f5dd9d..ecf1bc6 100644 (file)
@@ -1,3 +1,10 @@
+2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR c++/39425
+       * parser.c (cp_parser_explicit_specialization): Don't skip the
+       rest of the specialization when begin_specialization returns
+       false.
+
 2009-03-17  Jason Merrill  <jason@redhat.com>
 
        * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
index 4c6fd4a..7206af2 100644 (file)
@@ -10883,7 +10883,6 @@ cp_parser_explicit_specialization (cp_parser* parser)
   if (!begin_specialization ())
     {
       end_specialization ();
-      cp_parser_skip_to_end_of_block_or_statement (parser);
       return;
     }
 
index b59350c..c9d0832 100644 (file)
@@ -1,3 +1,10 @@
+2009-03-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR c++/39425
+       * g++.dg/template/pr39425.C: New.
+
+       * g++.dg/template/spec33.C: Updated.
+
 2009-03-17  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp0x/auto6.C, auto12.C: Update mangling.
diff --git a/gcc/testsuite/g++.dg/template/pr39425.C b/gcc/testsuite/g++.dg/template/pr39425.C
new file mode 100644 (file)
index 0000000..a063e05
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/39425
+// { dg-do compile }
+
+class a {
+
+  template<unsigned int s>
+    struct _rec {
+      static const char size = _rec< (s >> 1) >::size;
+    };
+
+  template<>   // { dg-error "explicit" }
+  struct _rec <0> {
+    static const char size = 0;
+  };
+
+  static const unsigned int value = _rec < 1 >::size;
+
+}              // { dg-error "unqualified-id" }
index 809d4f0..7b7a751 100644 (file)
@@ -3,5 +3,5 @@
 struct A
 {
     template<int> static void foo   () {}
-    template<>    static void foo<0>() {}  // { dg-error "explicit" }
+    template<>    static void foo<0>() {}  // { dg-error "explicit|template" }
 };