[PATCH] D25816: Use descriptive message if list initializer is incorrectly parenthesized.

Serge Pavlov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 00:48:04 PDT 2016


sepavloff created this revision.
sepavloff added a subscriber: cfe-commits.

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 much help. Both gcc and msvc issue message
`list-initializer for non-class type must not be parenthesized`, which is more
descriptive. This change implements similar behavior for clang also.


https://reviews.llvm.org/D25816

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25816.75270.patch
Type: text/x-patch
Size: 6055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161020/26821541/attachment.bin>


More information about the cfe-commits mailing list