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
+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.
if (!begin_specialization ())
{
end_specialization ();
- cp_parser_skip_to_end_of_block_or_statement (parser);
return;
}
+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.
--- /dev/null
+// 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" }
struct A
{
template<int> static void foo () {}
- template<> static void foo<0>() {} // { dg-error "explicit" }
+ template<> static void foo<0>() {} // { dg-error "explicit|template" }
};