diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-02-16 09:31:36 +0000 |
| commit | ecb7e5c8afe929ee38155db94de6b084ec32a645 (patch) | |
| tree | 53010172e19c77ea447bcd89e117cda052ab52e0 /test/SemaCXX/warn-unused-variables.cpp | |
| parent | 5044f5c816adfd5cba17f1adee1a10127296d0bf (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/warn-unused-variables.cpp')
| -rw-r--r-- | test/SemaCXX/warn-unused-variables.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp index 5620248f5005..3b5349a5ce1b 100644 --- a/test/SemaCXX/warn-unused-variables.cpp +++ b/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; +} |
