Fix handling of initialization from parenthesized initializer list.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 24 Mar 2017 01:14:25 +0000 (01:14 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 24 Mar 2017 01:14:25 +0000 (01:14 +0000)
commit49a6b6e91edfa67320fcde5d4c8455acab0010a3
tree1eb06064b1abcfd64a4d76a75f56be2df4274cf8
parentc3ddb655ccfc6c10f1fb07e094ac85b0f5e53482
Fix handling of initialization from parenthesized initializer list.

This change fixes a crash on initialization of a reference from ({}) during
template instantiation and incidentally improves diagnostics.

This reverts a prior attempt to handle this in r286721. Instead, we teach the
initialization code that initialization cannot be performed if a source type
is required and the initializer is an initializer list (which is not an
expression and does not have a type), and likewise for function-style cast
expressions.

llvm-svn: 298676
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Initialization.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaInit.cpp
clang/test/SemaCXX/cxx0x-initializer-constructor.cpp
clang/test/SemaCXX/cxx0x-initializer-references.cpp
clang/test/SemaCXX/cxx0x-initializer-scalars.cpp
clang/test/SemaCXX/type-convert-construct.cpp