summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-gnu.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-08-04 17:03:51 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-08-04 17:03:51 +0000
commit5d153e313394854730391eed5193e50137160f69 (patch)
tree14f0f61d75a63c2ed679524f2516d124d5131404 /clang/test/SemaCXX/attr-gnu.cpp
parent329eda3b82b9a035398d567ac1aa3c695cd37c80 (diff)
downloadbcm5719-llvm-5d153e313394854730391eed5193e50137160f69.tar.gz
bcm5719-llvm-5d153e313394854730391eed5193e50137160f69.zip
Diagnose GNU-style attributes preceding virt-specifiers, but only when the attribute is known to GCC. Clang accepts attributes in this position, but
GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed. llvm-svn: 214730
Diffstat (limited to 'clang/test/SemaCXX/attr-gnu.cpp')
-rw-r--r--clang/test/SemaCXX/attr-gnu.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-gnu.cpp b/clang/test/SemaCXX/attr-gnu.cpp
index 3d23ed945e4..b4e9f4609f6 100644
--- a/clang/test/SemaCXX/attr-gnu.cpp
+++ b/clang/test/SemaCXX/attr-gnu.cpp
@@ -11,3 +11,19 @@ void f() {
}
void g(int a[static [[]] 5]); // expected-error {{static array size is a C99 feature, not permitted in C++}}
+
+namespace {
+class B {
+public:
+ virtual void test() {}
+ virtual void test2() {}
+ virtual void test3() {}
+};
+
+class D : public B {
+public:
+ void test() __attribute__((deprecated)) final {} // expected-warning {{GCC does not allow an attribute in this position on a function declaration}}
+ void test2() [[]] override {} // Ok
+ void test3() __attribute__((cf_unknown_transfer)) override {} // Ok, not known to GCC.
+};
+}
OpenPOWER on IntegriCloud