]> granicus.if.org Git - clang/commit
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)
commit937ed2d04c7e48b8664eecaca3a36ebacf2fe450
tree3d36055163738b40e57458dcbc789337f0029e95
parent602fa8fe0aeaeff00fe5958840fd1dd60f80e073
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286721 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/cxx0x-initializer-references.cpp
test/SemaCXX/cxx0x-initializer-scalars.cpp