diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-12 01:50:05 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-02-12 01:50:05 +0000 |
commit | 420fa12dfddc33b0d0b54666340bfa630b61b5bc (patch) | |
tree | e56b01c02b267ed63d582e87da5da4e9e77f654e /clang/test/SemaCXX/cxx0x-initializer-constructor.cpp | |
parent | 7a0516ea668b3ee511b3e5a4f16438189d1a78ae (diff) | |
download | bcm5719-llvm-420fa12dfddc33b0d0b54666340bfa630b61b5bc.tar.gz bcm5719-llvm-420fa12dfddc33b0d0b54666340bfa630b61b5bc.zip |
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
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-initializer-constructor.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx0x-initializer-constructor.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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 } |