diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/SemaCXX/warn-unused-variables.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/warn-unused-variables.cpp')
| -rw-r--r-- | test/SemaCXX/warn-unused-variables.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/test/SemaCXX/warn-unused-variables.cpp b/test/SemaCXX/warn-unused-variables.cpp index 93d2f6f9563b6..8dcbe7271d69d 100644 --- a/test/SemaCXX/warn-unused-variables.cpp +++ b/test/SemaCXX/warn-unused-variables.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify %s template<typename T> void f() { T t; t = 17; @@ -115,6 +115,28 @@ namespace PR11550 { } } +namespace PR19305 { + template<typename T> int n = 0; // no warning + int a = n<int>; + + template<typename T> const int l = 0; // no warning + int b = l<int>; + + // PR19558 + template<typename T> const int o = 0; // no warning + template<typename T> const int o<T*> = 0; // no warning + int c = o<int*>; + + template<> int o<void> = 0; // no warning + int d = o<void>; + + // FIXME: It'd be nice to warn here. + template<typename T> int m = 0; + template<typename T> int m<T*> = 0; + + template<> const int m<void> = 0; // expected-warning {{unused variable}} +} + namespace ctor_with_cleanups { struct S1 { ~S1(); @@ -128,26 +150,3 @@ namespace ctor_with_cleanups { } #include "Inputs/warn-unused-variables.h" - -namespace PR8455 { - void f() { - A: // expected-warning {{unused label 'A'}} - __attribute__((unused)) int i; // attribute applies to variable - B: // attribute applies to label - __attribute__((unused)); int j; // expected-warning {{unused variable 'j'}} - } - - void g() { - C: // unused label 'C' will not appear here because an error occurs - __attribute__((unused)) - #pragma weak unused_local_static // expected-error {{expected ';' after __attribute__}} - ; - } - - void h() { - D: // expected-warning {{unused label 'D'}} - #pragma weak unused_local_static - __attribute__((unused)) // expected-warning {{declaration does not declare anything}} - ; - } -} |
