From 8beb26e4fa3493fe1772f1b7c88de99cbaf2e438 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 14 Sep 2012 16:38:59 +0000 Subject: [PATCH] Add missing test from r163874. llvm-svn: 163910 --- clang/test/SemaCXX/attr-unused.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 clang/test/SemaCXX/attr-unused.cpp diff --git a/clang/test/SemaCXX/attr-unused.cpp b/clang/test/SemaCXX/attr-unused.cpp new file mode 100644 index 000000000000..b74bc915ce07 --- /dev/null +++ b/clang/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}} +}