From 93638b751a7fe1ea4d89a8e9fa1db4dd52496a04 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 14 Oct 2017 14:46:04 +0000 Subject: Revert rL315787, "[Sema] Warn about unused variables if we can constant evaluate the initializer." check-libcxx dislikes it. llvm-svn: 315806 --- clang/test/SemaCXX/warn-unused-variables.cpp | 33 ---------------------------- 1 file changed, 33 deletions(-) (limited to 'clang/test/SemaCXX/warn-unused-variables.cpp') diff --git a/clang/test/SemaCXX/warn-unused-variables.cpp b/clang/test/SemaCXX/warn-unused-variables.cpp index 0974cf5a61d..d7be785b35a 100644 --- a/clang/test/SemaCXX/warn-unused-variables.cpp +++ b/clang/test/SemaCXX/warn-unused-variables.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify %s -// RUN: %clang_cc1 -fsyntax-only -Wunused-variable -Wunused-label -Wno-c++1y-extensions -verify -std=c++11 %s template void f() { T t; t = 17; @@ -195,35 +194,3 @@ void test() { } } - -#if __cplusplus >= 201103L -namespace with_constexpr { -template -struct Literal { - T i; - Literal() = default; - constexpr Literal(T i) : i(i) {} -}; - -struct NoLiteral { - int i; - NoLiteral() = default; - constexpr NoLiteral(int i) : i(i) {} - ~NoLiteral() {} -}; - -static Literal gl1; // expected-warning {{unused variable 'gl1'}} -static Literal gl2(1); // expected-warning {{unused variable 'gl2'}} -static const Literal gl3(0); // expected-warning {{unused variable 'gl3'}} - -template -void test(int i) { - Literal l1; // expected-warning {{unused variable 'l1'}} - Literal l2(42); // expected-warning {{unused variable 'l2'}} - Literal l3(i); // no-warning - Literal l4(0); // no-warning - NoLiteral nl1; // no-warning - NoLiteral nl2(42); // no-warning -} -} -#endif -- cgit v1.2.3