diff options
Diffstat (limited to 'test/Parser/cxx0x-attributes.cpp')
-rw-r--r-- | test/Parser/cxx0x-attributes.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Parser/cxx0x-attributes.cpp b/test/Parser/cxx0x-attributes.cpp index c68a119..7eec576 100644 --- a/test/Parser/cxx0x-attributes.cpp +++ b/test/Parser/cxx0x-attributes.cpp @@ -288,6 +288,7 @@ namespace arguments { void f[[gnu::format(printf, 1, 2)]](const char*, ...); void g() [[unknown::foo(ignore arguments for unknown attributes, even with symbols!)]]; // expected-warning {{unknown attribute 'foo' ignored}} [[deprecated("with argument")]] int i; + // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}} } // Forbid attributes on decl specifiers. @@ -330,8 +331,12 @@ namespace GccASan { namespace { [[deprecated]] void bar(); + // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}} [[deprecated("hello")]] void baz(); - [[deprecated()]] void foo(); // expected-error {{parentheses must be omitted if 'deprecated' attribute's argument list is empty}} + // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}} + [[deprecated()]] void foo(); + // expected-error@-1 {{parentheses must be omitted if 'deprecated' attribute's argument list is empty}} + // expected-warning@-2 {{use of the 'deprecated' attribute is a C++14 extension}} [[gnu::deprecated()]] void quux(); } @@ -341,3 +346,10 @@ namespace { deprecated ]] void bad(); } + +#define attr_name bitand +#define attr_name_2(x) x +#define attr_name_3(x, y) x##y +[[attr_name, attr_name_2(bitor), attr_name_3(com, pl)]] int macro_attrs; // expected-warning {{unknown attribute 'compl' ignored}} \ + expected-warning {{unknown attribute 'bitor' ignored}} \ + expected-warning {{unknown attribute 'bitand' ignored}} |