Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.robertl/eb69.C

raw
1 // { dg-do assemble }
2 // Test that g++ complains about referring to a builtin type in a
3 // mem-initializer.
4 // Contributed by Kevin Buhr <[email protected]>
5
6 int r = 0;
7
8 struct foo { // { dg-message "note" } candidate
9 foo(int x) { r = 1; } // { dg-message "note" }
10 };
11
12 struct bar : foo {
13 typedef int an_int;
14 bar() : bar::an_int(3) {} // { dg-error "match" "match" } not a base
15 // { dg-message "expected" "exp" { target *-*-* } .-1 }
16 };
17
18 int
19 main() {
20 bar b;
21 return r;
22 }