diff options
author | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-05 16:50:57 +0000 |
---|---|---|
committer | Giovanni Bajo <giovannibajo@gcc.gnu.org> | 2004-02-05 16:50:57 +0000 |
commit | 2f69c594130c1b4f086e399d5148b9b3f802c5a0 (patch) | |
tree | 17fcb57baad109a013497c78a310632abd1e02f0 | |
parent | 2097b5f2d342d2910e322a4140635c25bfef04ec (diff) | |
download | gcc-2f69c594130c1b4f086e399d5148b9b3f802c5a0.zip gcc-2f69c594130c1b4f086e399d5148b9b3f802c5a0.tar.gz gcc-2f69c594130c1b4f086e399d5148b9b3f802c5a0.tar.bz2 |
re PR c++/14008 (Confusing diagnostic when omitting a template parameter)
PR c++/14008
* g++.dg/parse/error15.C: New test.
* g++.dg/parse/crash11.C: Update dg-error mark.
From-SVN: r77324
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/crash11.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/error15.C | 39 |
3 files changed, 46 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df3236f..50de43f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-02-05 Giovanni Bajo <giovannibajo@gcc.gnu.org> + + PR c++/14008 + * g++.dg/parse/error15.C: New test. + * g++.dg/parse/crash11.C: Update dg-error mark. + 2004-02-04 Mark Mitchell <mark@codesourcery.com> PR c++/13932 diff --git a/gcc/testsuite/g++.dg/parse/crash11.C b/gcc/testsuite/g++.dg/parse/crash11.C index 4893678..e6db364 100644 --- a/gcc/testsuite/g++.dg/parse/crash11.C +++ b/gcc/testsuite/g++.dg/parse/crash11.C @@ -30,5 +30,5 @@ struct C }; int main() { - typedef B<C>::Template<void>::Type Type; // { dg-error "init-declarator|;" } + typedef B<C>::Template<void>::Type Type; // { dg-error "does not name a type" } } diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C new file mode 100644 index 0000000..fd70382 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error15.C @@ -0,0 +1,39 @@ +// { dg-do compile } +// Contributed by Volker Reichelt <reichelt at gcc dot gnu dot org> +// PR c++/14008: Improve diagnostic on invalid types in declarators. + +namespace N +{ + template<int> struct A {}; + struct C {}; + int K; +} + +N::A f2; // { dg-error "without an argument list" } +N::INVALID f3; // { dg-error "in namespace `N' does not name a type" } +N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" } +N::K f6; // { dg-error "in namespace `N' does not name a type" } +typename N::A f7; // { dg-error "without an argument list|outside of template" } + +struct B +{ + N::A f2; // { dg-error "without an argument list" } + N::INVALID f3; // { dg-error "in namespace `N' does not name a type" } + N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" } + N::K f6; // { dg-error "in namespace `N' does not name a type" } + typename N::A f7; // { dg-error "without an argument list|outside of template" } +}; + +template <int> +struct C +{ + N::A f2; // { dg-error "without an argument list" } + N::INVALID f3; // { dg-error "in namespace `N' does not name a type" } + N::C::INVALID f4; // { dg-error "in class `N::C' does not name a type" } + N::K f6; // { dg-error "in namespace `N' does not name a type" } + typename N::A f7; // { dg-error "without an argument list" } +}; + +// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 16 } +// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 24 } +// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 34 } |