| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
// { dg-options "" } |
| 3 |
|
| 4 |
int |
| 5 |
foo () |
| 6 |
{ |
| 7 |
static int a [[using gnu: unused, used]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } } |
| 8 |
int b [[ using foo : bar (2), baz ]]; // { dg-warning "'foo::bar' scoped attribute directive ignored" } |
| 9 |
// { dg-warning "'foo::baz' scoped attribute directive ignored" "" { target *-*-* } .-1 } |
| 10 |
// { dg-warning "attribute using prefix only available" "" { target c++14_down } .-2 } |
| 11 |
int c [[ using foo : using ("foo")]]; // { dg-warning "'foo::using' scoped attribute directive ignored" } |
| 12 |
// { dg-warning "attribute using prefix only available" "" { target c++14_down } .-1 } |
| 13 |
b = 0; |
| 14 |
c = 0; |
| 15 |
return b + c; |
| 16 |
} |
| 17 |
|
| 18 |
int |
| 19 |
bar () |
| 20 |
{ |
| 21 |
int a [[ using BAR: foo::bar]]; // { dg-error "attribute using prefix used together with scoped attribute token" } |
| 22 |
// { dg-warning "ignored" "" { target *-*-* } .-1 } |
| 23 |
// { dg-warning "attribute using prefix only available" "" { target c++14_down } .-2 } |
| 24 |
int b [[ using BAZ: bar(2), bar::bar(3, 4) ]];// { dg-error "attribute using prefix used together with scoped attribute token" } |
| 25 |
// { dg-warning "ignored" "" { target *-*-* } .-1 } |
| 26 |
// { dg-warning "attribute using prefix only available" "" { target c++14_down } .-2 } |
| 27 |
a = 0; |
| 28 |
b = 0; |
| 29 |
return a + b; |
| 30 |
} |
| 31 |
|
| 32 |
int |
| 33 |
baz () |
| 34 |
{ |
| 35 |
int a [[ using using: using]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } } |
| 36 |
// { dg-warning "'using::using' scoped attribute directive ignored" "" { target *-*-* } .-1 } |
| 37 |
int b [[ using bitand: bitor, xor]]; // { dg-warning "attribute using prefix only available" "" { target c++14_down } } |
| 38 |
// { dg-warning "'bitand::bitor' scoped attribute directive ignored" "" { target *-*-* } .-1 } |
| 39 |
// { dg-warning "'bitand::xor' scoped attribute directive ignored" "" { target *-*-* } .-2 } |
| 40 |
a = 0; |
| 41 |
b = 0; |
| 42 |
return a + b; |
| 43 |
} |