forked from OSchip/llvm-project
Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.
llvm-svn: 114235
This commit is contained in:
parent
196cf88a01
commit
3586938d37
|
@ -521,8 +521,11 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) {
|
|||
if (Expr *Init = D->getInit()) {
|
||||
if (D->hasCXXDirectInitializer())
|
||||
Out << "(";
|
||||
else if (!dyn_cast<CXXConstructExpr>(Init))
|
||||
Out << " = ";
|
||||
else {
|
||||
CXXConstructExpr *CCE = dyn_cast<CXXConstructExpr>(Init);
|
||||
if (!CCE || CCE->getConstructor()->isCopyConstructor())
|
||||
Out << " = ";
|
||||
}
|
||||
Init->printPretty(Out, Context, 0, Policy, Indentation);
|
||||
if (D->hasCXXDirectInitializer())
|
||||
Out << ")";
|
||||
|
|
Loading…
Reference in New Issue