From: Douglas Gregor Date: Fri, 14 Sep 2012 16:38:59 +0000 (+0000) Subject: Add missing test from r163874. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=867c179ed3b5f338537a84da658ecac25addb9f7;p=clang Add missing test from r163874. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163910 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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}} +}