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-references.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-references.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx0x-initializer-references.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/cxx0x-initializer-references.cpp b/clang/test/SemaCXX/cxx0x-initializer-references.cpp index dda68a3ec94..f9164fb1ae6 100644 --- a/clang/test/SemaCXX/cxx0x-initializer-references.cpp +++ b/clang/test/SemaCXX/cxx0x-initializer-references.cpp @@ -110,7 +110,7 @@ namespace inner_init { struct D { C &&r; }; D d1 { 0 }; // ok, 0 implicitly converts to C D d2 { { 0 } }; // ok, { 0 } calls C(0) - D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }) + D d3 { { { 0 } } }; // ok, { { 0 } } calls C({ 0 }), expected-warning {{braces around scalar init}} D d4 { { { { 0 } } } }; // expected-error {{no matching constructor for initialization of 'inner_init::C &&'}} struct E { explicit E(int); }; // expected-note 2{{here}} |