Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle...
commitbca33bfeb5bda73ae1cce89e3080f61a926c3d57
authorArgiris Kirtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:08:37 +0000 (6 23:08 +0000)
committerArgiris Kirtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:08:37 +0000 (6 23:08 +0000)
tree3fa819c174bc72ae3512f2a7874aaf2428b70f6c
parent5c29a5a9408d216d1a7c7d59913f94445a5218e9
Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr.
Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization.

In the case of "int x( expression );":
-The Init expression of VarDecl 'x' will be the expression inside the parentheses.
-VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57219 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Decl.h
include/clang/Basic/DiagnosticKinds.def
lib/Sema/SemaDeclCXX.cpp