Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / gen-attrs-78.C
blob28b95439038f4e1463316deeeed8be813047d95b
1 // PR c++/109756
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wno-attributes" }
5 template <int ...args>
6 [[noreturn...]]                                 // { dg-error "attribute with no arguments contains no parameter packs" }
7 [[deprecated...]]                               // { dg-error "attribute with no arguments contains no parameter packs" }
8 [[nodiscard...]]                                // { dg-error "attribute with no arguments contains no parameter packs" }
9 int foo (int x)
11   switch (x)
12     {
13     case 1:
14       [[likely...]];                            // { dg-error "attribute with no arguments contains no parameter packs" }
15       [[fallthrough...]];                       // { dg-error "attribute with no arguments contains no parameter packs" }
16     case 2:
17       [[unlikely...]];                          // { dg-error "attribute with no arguments contains no parameter packs" }
19       break;
20     default:
21       break;
22     }
23   struct T {};
24   struct S { [[no_unique_address...]] T t; };   // { dg-error "attribute with no arguments contains no parameter packs" }
25   for (;;)
26     ;
29 int a = foo <1, 2, 3> (4);