diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-28 22:54:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-28 22:54:55 +0000 |
commit | 90820ee62a9217e6da4ee0a7e1ae768ab3bcade3 (patch) | |
tree | c567d84a95d6b476b4532331b5235a0bcf04bf5b /clang/test/SemaCXX/attr-after-definition.cpp | |
parent | 601d6e4c7b012ff5dcda4089029c416014cb85c6 (diff) | |
download | bcm5719-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.cpp | 9 |
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); |