diff options
Diffstat (limited to 'test/SemaCXX/warn-unused-filescoped.cpp')
-rw-r--r-- | test/SemaCXX/warn-unused-filescoped.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/SemaCXX/warn-unused-filescoped.cpp b/test/SemaCXX/warn-unused-filescoped.cpp index dbff4b0e68c1..ad896b521204 100644 --- a/test/SemaCXX/warn-unused-filescoped.cpp +++ b/test/SemaCXX/warn-unused-filescoped.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wunused -Wunused-member-function -std=c++11 %s static void f1(); // expected-warning{{unused}} @@ -87,3 +88,16 @@ namespace rdar8733476 { foo(); } } + +namespace test5 { + static int n = 0; + static int &r = n; + int f(int &); + int k = f(r); + + // FIXME: We should produce warnings for both of these. + static const int m = n; + int x = sizeof(m); + static const double d = 0.0; + int y = sizeof(d); +} |