]> granicus.if.org Git - clang/commit
Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:08:37 +0000 (23:08 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 6 Oct 2008 23:08:37 +0000 (23:08 +0000)
commitce8e2926d8922bff7dc2661ec9c043dd619dcc82
tree3fa819c174bc72ae3512f2a7874aaf2428b70f6c
parent655137a6c19110620d82d5f03cdcaec3a48c059f
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