Commit 367bdb8d by H.J. Lu Committed by H.J. Lu

re PR c++/39425 (gcc loops after reporting template instantiation errors)

gcc/cp/

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.

From-SVN: r144932
parent 95158172
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.
......
......@@ -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;
}
......
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.
......
// 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" }
......@@ -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" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment