diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaCXX/cxx0x-compat.cpp | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index 5db06bd3f2a..a803085cd31 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/test/Parser/cxx0x-attributes.cpp @@ -127,7 +127,7 @@ extern "C++" [[]] { } // expected-error {{an attribute list cannot appear here}} [[]] using ns::i; // expected-error {{an attribute list cannot appear here}} [[unknown]] using namespace ns; // expected-warning {{unknown attribute 'unknown' ignored}} [[noreturn]] using namespace ns; // expected-error {{'noreturn' attribute only applies to functions}} -namespace [[]] ns2 {} // expected-warning {{attributes on a namespace declaration are incompatible with C++ standards before C++17}} +namespace [[]] ns2 {} // expected-warning {{attributes on a namespace declaration are a C++17 extension}} using [[]] alignas(4) [[]] ns::i; // expected-error {{an attribute list cannot appear here}} using [[]] alignas(4) [[]] foobar = int; // expected-error {{an attribute list cannot appear here}} expected-error {{'alignas' attribute only applies to}} @@ -179,7 +179,7 @@ enum [[]] E2; // expected-error {{forbids forward references}} enum [[]] E1; enum [[]] E3 : int; enum [[]] { - k_123 [[]] = 123 // expected-warning {{attributes on an enumerator declaration are incompatible with C++ standards before C++17}} + k_123 [[]] = 123 // expected-warning {{attributes on an enumerator declaration are a C++17 extension}} }; enum [[]] E1 e; // expected-error {{an attribute list cannot appear here}} enum [[]] class E4 { }; // expected-error {{an attribute list cannot appear here}} diff --git a/clang/test/SemaCXX/cxx0x-compat.cpp b/clang/test/SemaCXX/cxx0x-compat.cpp index 8f7aaab6a43..b9ccadd85c2 100644 --- a/clang/test/SemaCXX/cxx0x-compat.cpp +++ b/clang/test/SemaCXX/cxx0x-compat.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++11-compat -verify %s -// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++11-compat -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++11-compat-pedantic -verify %s +// RUN: %clang_cc1 -fsyntax-only -std=c++17 -Wc++11-compat-pedantic -verify %s #if __cplusplus < 201103L @@ -52,4 +52,7 @@ static_assert(true); // expected-warning {{incompatible with C++ standards befor template<int ...N> int f() { return (N + ...); } // expected-warning {{incompatible with C++ standards before C++17}} +namespace [[]] NS_with_attr {} // expected-warning {{incompatible with C++ standards before C++17}} +enum { e [[]] }; // expected-warning {{incompatible with C++ standards before C++17}} + #endif |