| 1 |
// PR c++/109756 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wno-attributes" } |
| 4 |
|
| 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) |
| 10 |
{ |
| 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" } |
| 18 |
|
| 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 |
; |
| 27 |
} |
| 28 |
|
| 29 |
int a = foo <1, 2, 3> (4); |