Debian Codegraph @

gcc/testsuite/g++.dg/inherit/pure1.C

raw
1 // PR c++/23266
2 // Origin: Volker Reichelt <[email protected]>
3 // { dg-do compile }
4
5 void foo0() = 0; // { dg-error "6:function .void foo0\\(\\). is initialized like a variable" }
6 virtual void foo1() = 0; // { dg-error "1:'virtual' outside class" }
7 // { dg-error "14:function .void foo1\\(\\). is initialized like a variable" "" { target *-*-* } .-1 }
8 struct A
9 {
10 void foo2() = 0; // { dg-error "8:initializer specified for non-virtual method" }
11 static void foo3() = 0; // { dg-error "15:initializer specified for static member function" }
12 virtual static void foo4() = 0; // { dg-error "both 'virtual' and 'static'" }
13 virtual void foo5() = 0; // { dg-error "base class" }
14 };
15
16 struct B : A
17 {
18 static void foo5() = 0; // { dg-error "15:initializer specified for static member function" }
19 // { dg-error "declared" "" { target *-*-* } .-1 }
20 };