Merged revisions 143552,143554,143557,143560,143562,143564-143567,143570-143573,14357...
[official-gcc.git] / gcc / testsuite / g++.dg / parse / crash40.C
blob6a15228c0632c5e4767a169758bea0a5c1486825
1 /* PR c++/34059 */
2 /* { dg-do "compile" } */
4 struct A
6   template<int> void foo();
7 };
8 struct B : A {};
9 struct C : A {};
11 class AA
13   template<int> void foo(); /* { dg-error "is private" } */
15 struct BB : AA {};
17 class AAA {
18   int get() const {}
20 struct BBB {
21   static BBB *foo();
22 private:
23   int get() const {} /* { dg-error "is private" } */
25 template<bool> struct S {
26   S(unsigned int = BBB::foo()->AAA::get()); /* { dg-error "is not a base of" } */
28 template<bool> struct SS {
29   SS(unsigned int = BBB::foo()->get());
32 void bar()
34   B().C::foo<0>(); /* { dg-error "is not a member of" } */
35   BB().AA::foo<0>(); /* { dg-error "within this context" } */
37   int i;
38   i.C::foo<0>(); /* { dg-error "which is of non-class type" } */
40   S<false> s; /* { dg-error "default argument" } */
41   SS<false> ss; /* { dg-error "within this context" } */