summaryrefslogtreecommitdiffstats
path: root/clang/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
commite1368a107a3ec58b121d369468d8d047c3201395 (patch)
tree47acbffa7ae72b43c294c69480d19b324ad7134a /clang/test/SemaCXX/warn-unused-variables-error.cpp
parentb0640dc2b664ba74496ae83740cf66b8fbebaa32 (diff)
downloadbcm5719-llvm-e1368a107a3ec58b121d369468d8d047c3201395.tar.gz
bcm5719-llvm-e1368a107a3ec58b121d369468d8d047c3201395.zip
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. llvm-svn: 179138
Diffstat (limited to 'clang/test/SemaCXX/warn-unused-variables-error.cpp')
-rw-r--r--clang/test/SemaCXX/warn-unused-variables-error.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-unused-variables-error.cpp b/clang/test/SemaCXX/warn-unused-variables-error.cpp
new file mode 100644
index 00000000000..6386c4b6824
--- /dev/null
+++ b/clang/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>'}}
+ }
+}
OpenPOWER on IntegriCloud