summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/attr-after-definition.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-28 22:54:55 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-28 22:54:55 +0000
commit90820ee62a9217e6da4ee0a7e1ae768ab3bcade3 (patch)
treec567d84a95d6b476b4532331b5235a0bcf04bf5b /clang/test/SemaCXX/attr-after-definition.cpp
parent601d6e4c7b012ff5dcda4089029c416014cb85c6 (diff)
downloadbcm5719-llvm-90820ee62a9217e6da4ee0a7e1ae768ab3bcade3.tar.gz
bcm5719-llvm-90820ee62a9217e6da4ee0a7e1ae768ab3bcade3.zip
Make sure we actually found a redeclaration before complaining about attributes added to a redeclaration in C++
llvm-svn: 80403
Diffstat (limited to 'clang/test/SemaCXX/attr-after-definition.cpp')
-rw-r--r--clang/test/SemaCXX/attr-after-definition.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-after-definition.cpp b/clang/test/SemaCXX/attr-after-definition.cpp
new file mode 100644
index 00000000000..2ef5acfbc0f
--- /dev/null
+++ b/clang/test/SemaCXX/attr-after-definition.cpp
@@ -0,0 +1,9 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+struct X { };
+struct Y { };
+
+bool f0(X) { return true; } // expected-note{{definition}}
+bool f1(X) { return true; }
+
+__attribute__ ((__visibility__("hidden"))) bool f0(X); // expected-warning{{attribute}}
+__attribute__ ((__visibility__("hidden"))) bool f1(Y);
OpenPOWER on IntegriCloud