Use descriptive message if list initializer is incorrectly parenthesized.
authorSerge Pavlov <sepavloff@gmail.com>
Sat, 12 Nov 2016 15:38:55 +0000 (15:38 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Sat, 12 Nov 2016 15:38:55 +0000 (15:38 +0000)
commit3852637005b1528aac2d2e12ac7c03cb6f300e26
treef4b28d3d5541f27d3f6ab31547ed5315a85a0749
parenta583be4e52d9f7d0fd36e1d44836d8297cedda2a
Use descriptive message if list initializer is incorrectly parenthesized.

If initializer contains parentheses around braced list where it is not allowed,
as in construct int({0}), clang issued message like `functional-style cast
from 'void' to 'int' is not allowed`, which does not help much. Both gcc and
msvc issue message `list-initializer for non-class type must not be
parenthesized`, which is more descriptive. This change implements similar
message for clang.

Differential Revision: https://reviews.llvm.org/D25816

llvm-svn: 286721
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/test/SemaCXX/cxx0x-initializer-references.cpp
clang/test/SemaCXX/cxx0x-initializer-scalars.cpp