From 420fa12dfddc33b0d0b54666340bfa630b61b5bc Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 12 Feb 2015 01:50:05 +0000 Subject: Improve the "braces around scalar init" warning to determine whether to warn based on whether "redundant" braces are ever reasonable as part of the initialization of the entity, rather than whether the initialization is "top-level". In passing, add a warning flag for it. llvm-svn: 228896 --- clang/test/SemaCXX/cxx0x-initializer-constructor.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/test/SemaCXX/cxx0x-initializer-constructor.cpp') diff --git a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp index 0cd5aa7401a..6202bf620fe 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-constructor.cpp @@ -142,6 +142,7 @@ namespace objects { one ov2(int); two ov2(F<3>); + // expected-warning@+1 {{braces around scalar initializer}} static_assert(sizeof(ov2({1})) == sizeof(one), "bad overload"); // list -> int ranks as identity static_assert(sizeof(ov2({1, 2, 3})) == sizeof(two), "bad overload"); // list -> F only viable } -- cgit v1.2.3