aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-unused-variables-error.cpp
diff options
context:
space:
mode:
authorMatt Beaumont-Gay <matthewbg@google.com>2013-04-10 00:47:10 +0000
committerMatt Beaumont-Gay <matthewbg@google.com>2013-04-10 00:47:10 +0000
commit19b6a707a86302adc80d64464cbc3cb8a7a7f3a6 (patch)
tree6cf3a4f01e7e76e11c016cb803bbf65f5891e12c /test/SemaCXX/warn-unused-variables-error.cpp
parent8da488dc0bf10d0b6b8861653e8014f0d06fe322 (diff)
Suppress -Wunused-variable for variables declared in headers, which may in
fact be defined and used in another TU. Reshuffle some test cases because we suppress -Wunused-variable after we've emitted an error. This fixes PR15558. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-unused-variables-error.cpp')
-rw-r--r--test/SemaCXX/warn-unused-variables-error.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-variables-error.cpp b/test/SemaCXX/warn-unused-variables-error.cpp
new file mode 100644
index 0000000000..6386c4b682
--- /dev/null
+++ b/test/SemaCXX/warn-unused-variables-error.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s
+
+namespace PR6948 {
+ template<typename T> class X; // expected-note{{template is declared here}}
+
+ void f() {
+ X<char> str (read_from_file()); // expected-error{{use of undeclared identifier 'read_from_file'}} \
+ expected-error{{implicit instantiation of undefined template 'PR6948::X<char>'}}
+ }
+}