diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-03-18 14:56:45 +0000 |
---|---|---|
committer | H.J. Lu <hongjiu.lu@intel.com> | 2009-03-18 14:56:45 +0000 |
commit | 04950246083c7f98cc4ed14917d8ab2a876ddb49 (patch) | |
tree | 17f05bc8e31416fe9abbddc49d4e73e8ec552ab8 | |
parent | 8b7dfe7fb6fea6d16fef0eb7386e6266a6201866 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@144932 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/parser.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/pr39425.C | 18 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/spec33.C | 2 |
5 files changed, 33 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1f5dd9d75f5..ecf1bc634ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 4c6fd4a78c5..7206af2e4a4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b59350c5444..c9d0832fbc3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 00000000000..a063e05c2c7 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr39425.C @@ -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" } diff --git a/gcc/testsuite/g++.dg/template/spec33.C b/gcc/testsuite/g++.dg/template/spec33.C index 809d4f012c1..7b7a7519829 100644 --- a/gcc/testsuite/g++.dg/template/spec33.C +++ b/gcc/testsuite/g++.dg/template/spec33.C @@ -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" } }; |