PR c++/16706
[official-gcc.git] / gcc / testsuite / g++.dg / parse / error15.C
blobfd70382471887dfb46287c385b798d10df606738
1 // { dg-do compile }
2 // Contributed by Volker Reichelt <reichelt at gcc dot gnu dot org> 
3 // PR c++/14008: Improve diagnostic on invalid types in declarators.
5 namespace N
6
7   template<int> struct A {};
8   struct C {};
9   int K;
12 N::A f2;              // { dg-error "without an argument list" }
13 N::INVALID f3;        // { dg-error "in namespace `N' does not name a type" }
14 N::C::INVALID f4;     // { dg-error "in class `N::C' does not name a type" }
15 N::K f6;              // { dg-error "in namespace `N' does not name a type" }
16 typename N::A f7;     // { dg-error "without an argument list|outside of template" }
18 struct B
20   N::A f2;            // { dg-error "without an argument list" }
21   N::INVALID f3;      // { dg-error "in namespace `N' does not name a type" }
22   N::C::INVALID f4;   // { dg-error "in class `N::C' does not name a type" }
23   N::K f6;            // { dg-error "in namespace `N' does not name a type" }
24   typename N::A f7;   // { dg-error "without an argument list|outside of template" }
27 template <int>
28 struct C
30   N::A f2;            // { dg-error "without an argument list" }
31   N::INVALID f3;      // { dg-error "in namespace `N' does not name a type" }
32   N::C::INVALID f4;   // { dg-error "in class `N::C' does not name a type" }
33   N::K f6;            // { dg-error "in namespace `N' does not name a type" }
34   typename N::A f7;   // { dg-error "without an argument list" }
37 // { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 16 }
38 // { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 24 }
39 // { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 34 }