diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-11 22:55:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-11 22:55:30 +0000 |
commit | 50dc219e8b1ca70a9b92aa3486c047636115cb27 (patch) | |
tree | 8d342ffc8956e4d7d86297dd655b22ad2b8230a1 /clang/test | |
parent | 9d6eb40ce7c28d4a0715c8699070ea2be41f40f7 (diff) | |
download | bcm5719-llvm-50dc219e8b1ca70a9b92aa3486c047636115cb27.tar.gz bcm5719-llvm-50dc219e8b1ca70a9b92aa3486c047636115cb27.zip |
When we have a dependent direct initializer but not a dependent
variable type, we can (and should) still check for completeness of the
variable's type. Do so, to work around an assertion that shows up in
Boost's shared_ptr.
llvm-svn: 95934
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/warn-unused-variables.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/clang/test/SemaCXX/warn-unused-variables.cpp b/clang/test/SemaCXX/warn-unused-variables.cpp index 5620248f500..3b5349a5ce1 100644 --- a/clang/test/SemaCXX/warn-unused-variables.cpp +++ b/clang/test/SemaCXX/warn-unused-variables.cpp @@ -1,8 +1,7 @@ -// RUN: %clang -fsyntax-only -Wunused-variable -verify %s - +// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -verify %s template<typename T> void f() { - T t; - t = 17; + T t; + t = 17; } // PR5407 @@ -27,7 +26,7 @@ namespace PR5531 { }; void test() { - A(); + A(); // expected-warning{{expression result unused}} B(17); C(); } @@ -43,3 +42,12 @@ void bah() { x.foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}} x2->foo(); // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}} } + +template<typename T> +struct X0 { }; + +template<typename T> +void test_dependent_init(T *p) { + X0<int> i(p); + (void)i; +} |