summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/cxx0x-attributes.cpp7
-rw-r--r--clang/test/SemaCXX/for-range-examples.cpp2
-rw-r--r--clang/test/SemaCXX/generalized-deprecated.cpp14
3 files changed, 21 insertions, 2 deletions
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp
index c68a119fc74..ab0ce192fca 100644
--- a/clang/test/Parser/cxx0x-attributes.cpp
+++ b/clang/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();
}
diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp
index d07331c51e2..f2b155ad7e5 100644
--- a/clang/test/SemaCXX/for-range-examples.cpp
+++ b/clang/test/SemaCXX/for-range-examples.cpp
@@ -226,7 +226,7 @@ namespace test7 {
// we check the alignment attribute before we perform the auto
// deduction.
for (d alignas(1) : arr) {} // expected-error {{requires type for loop variable}}
- for (e [[deprecated]] : arr) { e = 0; } // expected-warning {{deprecated}} expected-note {{here}} expected-error {{requires type for loop variable}}
+ for (e [[deprecated]] : arr) { e = 0; } // expected-warning{{use of the deprecated attribute is a C++14 extension}} expected-warning {{deprecated}} expected-note {{here}} expected-error {{requires type for loop variable}}
}
}
diff --git a/clang/test/SemaCXX/generalized-deprecated.cpp b/clang/test/SemaCXX/generalized-deprecated.cpp
new file mode 100644
index 00000000000..3bb42df499a
--- /dev/null
+++ b/clang/test/SemaCXX/generalized-deprecated.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only -Wno-deprecated %s
+
+// NOTE: use -Wno-deprecated to avoid cluttering the output with deprecated
+// warnings
+
+[[deprecated("1")]] int function_1();
+// expected-warning@-1 {{use of the deprecated attribute is a C++14 extension}}
+
+[[gnu::deprecated("3")]] int function_3();
+
+int __attribute__ (( deprecated("2") )) function_2();
+
+__declspec(deprecated("4")) int function_4();
+
OpenPOWER on IntegriCloud