Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / warn / deprecated-19.C
blob561f1241e005808c205d68fa27d9542857e67fea
1 // PR c++/116636
2 // { dg-do compile }
3 // { dg-options "-pedantic -Wdeprecated" }
5 struct A {
6   virtual int foo () = 0;
7 };
8 struct B : virtual A {
9   [[deprecated]] int foo () { return 0; }       // { dg-message "declared here" }
10 };                                              // { dg-warning "C\\\+\\\+11 attributes only available with" "" { target c++98_only } .-1 }
11 struct C : virtual A {
12   [[gnu::unavailable]] int foo () { return 0; } // { dg-message "declared here" }
13 };                                              // { dg-warning "C\\\+\\\+11 attributes only available with" "" { target c++98_only } .-1 }
15 void
16 bar ()
18   B b;
19   b.foo ();                                     // { dg-warning "'virtual int B::foo\\\(\\\)' is deprecated" }
20   C c;
21   c.foo ();                                     // { dg-error "'virtual int C::foo\\\(\\\)' is unavailable" }