| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-options "-Wno-attributes=bar:: -Wno-attributes=baz::qux" } |
| 3 |
|
| 4 |
[[foo::bar]]; // { dg-warning "attribute ignored" } |
| 5 |
[[bar::foo, foo::bar, baz::qux]]; // { dg-warning "attribute ignored" } |
| 6 |
[[bar::foo, bar::bar, baz::qux]]; // { dg-bogus "attribute ignored" } |
| 7 |
|
| 8 |
namespace [[foo::bar]] N { // { dg-warning "'bar' attribute directive ignored" } |
| 9 |
int n; |
| 10 |
} |
| 11 |
namespace [[bar::foo, foo::bar, baz::qux]] O { // { dg-warning "'bar' attribute directive ignored" } |
| 12 |
int o; |
| 13 |
} |
| 14 |
namespace [[bar::foo, bar::bar, baz::qux]] P { // { dg-bogus "attribute directive ignored" } |
| 15 |
int p; |
| 16 |
} |
| 17 |
|
| 18 |
void |
| 19 |
foo () |
| 20 |
{ |
| 21 |
int i = 0; |
| 22 |
[[foo::bar]]; // { dg-warning "attributes at the beginning of statement are ignored" } |
| 23 |
[[bar::foo, foo::bar, baz::qux]]; // { dg-warning "attributes at the beginning of statement are ignored" } |
| 24 |
[[bar::foo, bar::bar, baz::qux]]; // { dg-bogus "attributes at the beginning of statement are ignored" } |
| 25 |
[[foo::bar]] ++i; // { dg-warning "attributes at the beginning of statement are ignored" } |
| 26 |
[[bar::foo, foo::bar, baz::qux]] ++i; // { dg-warning "attributes at the beginning of statement are ignored" } |
| 27 |
[[bar::foo, bar::bar, baz::qux]] ++i; // { dg-bogus "attributes at the beginning of statement are ignored" } |
| 28 |
[[foo::bar]] asm (""); // { dg-warning "attributes ignored on 'asm' declaration" } |
| 29 |
[[bar::foo, foo::bar, baz::qux]] asm (""); // { dg-warning "attributes ignored on 'asm' declaration" } |
| 30 |
[[bar::foo, bar::bar, baz::qux]] asm (""); // { dg-bogus "attributes ignored on 'asm' declaration" } |
| 31 |
[[foo::bar]] using namespace N; // { dg-warning "'bar' attribute directive ignored" } |
| 32 |
[[bar::foo, foo::bar, baz::qux]] using namespace O; // { dg-warning "'bar' attribute directive ignored" } |
| 33 |
[[bar::foo, bar::bar, baz::qux]] using namespace P; // { dg-bogus "attribute directive ignored" } |
| 34 |
} |
| 35 |
|
| 36 |
class S |
| 37 |
{ |
| 38 |
[[foo::bar]] friend int bar (S &); // { dg-warning "attribute ignored" } |
| 39 |
// { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } |
| 40 |
[[bar::foo, foo::bar, baz::qux]] friend int baz (S &); // { dg-warning "attribute ignored" } |
| 41 |
// { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } |
| 42 |
[[bar::foo, bar::bar, baz::qux]] friend int qux (S &); // { dg-warning "attribute ignored" } |
| 43 |
// { dg-message "an attribute that appertains to a friend declaration that is not a definition is ignored" "" { target *-*-* } .-1 } |
| 44 |
public: |
| 45 |
int s; |
| 46 |
}; |
| 47 |
|
| 48 |
int [[foo::bar]] i; // { dg-warning "attribute ignored" } |
| 49 |
// { dg-message "an attribute that appertains to a type-specifier is ignored" "" { target *-*-* } .-1 } |
| 50 |
int [[bar::foo, foo::bar, baz::qux]] j; // { dg-warning "attribute ignored" } |
| 51 |
// { dg-message "an attribute that appertains to a type-specifier is ignored" "" { target *-*-* } .-1 } |
| 52 |
int [[bar::foo, bar::bar, baz::qux]] k; // { dg-bogus "attribute ignored" } |