c++, coroutines: Simplify separation of the user function body and ramp.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / attr-deprecated.C
blobec6f232b85863bd9a4660efc7c870645c8a4394d
1 // { dg-do compile { target c++14 } }
3 class [[deprecated]] A
5 };
7 [[deprecated]]
8 int
9 foo(int n)
11   return 42 + n;
14 class [[deprecated("B has been superceded by C")]] B
18 [[deprecated("bar is unsafe; use foobar instead")]]
19 int
20 bar(int n)
22   return 42 + n - 1;
25 #if __cplusplus > 201103L
27 //  Deprecate C for C++14 onwards.
28 class [[deprecated]] C;
30 //  Deprecate foobar for C++14 onwards.
31 [[deprecated]]
32 int
33 foobar(int n);
35 #endif
37 class C
41 int
42 foobar(int n)
44   return 43 + n - 1;
47 int
48 main()
50   A aaa; // { dg-warning "is deprecated" }
51   int n = foo(12); // { dg-warning "is deprecated" }
53   B bbb; // { dg-warning "is deprecated" "B has been superceded by C" }
54   int m = bar(666); // { dg-warning "is deprecated" "bar is unsafe; use foobar instead" }
56   C ccc; // { dg-warning "is deprecated" }
57   int l = foobar(8); // { dg-warning "is deprecated" }