diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-09-14 16:38:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-09-14 16:38:59 +0000 |
commit | 867c179ed3b5f338537a84da658ecac25addb9f7 (patch) | |
tree | 1dcec420d121923bd9c4ef16664fa9fd7172b2ee | |
parent | 8c05da3fd8db98af482826ba059ab1ad6d58010f (diff) |
Add missing test from r163874.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163910 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/SemaCXX/attr-unused.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/SemaCXX/attr-unused.cpp b/test/SemaCXX/attr-unused.cpp new file mode 100644 index 0000000000..b74bc915ce --- /dev/null +++ b/test/SemaCXX/attr-unused.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused -fsyntax-only %s + +namespace ns_unused { typedef int Int_unused __attribute__((unused)); } +namespace ns_not_unused { typedef int Int_not_unused; } + +void f() { + ns_not_unused::Int_not_unused i1; // expected-warning {{unused variable}} + ns_unused::Int_unused i0; // expected-warning {{'Int_unused' was marked unused but was used}} +} |