From: Ted Kremenek Date: Fri, 17 Sep 2010 23:04:38 +0000 (+0000) Subject: Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c57d655921ad0b20e1af50cbab5595520bd5da85;p=clang Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114235 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index e8c24965bd..a8f19952b6 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -521,8 +521,11 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) { if (Expr *Init = D->getInit()) { if (D->hasCXXDirectInitializer()) Out << "("; - else if (!dyn_cast(Init)) - Out << " = "; + else { + CXXConstructExpr *CCE = dyn_cast(Init); + if (!CCE || CCE->getConstructor()->isCopyConstructor()) + Out << " = "; + } Init->printPretty(Out, Context, 0, Policy, Indentation); if (D->hasCXXDirectInitializer()) Out << ")";