[cfe-commits] r114235 - /cfe/trunk/lib/AST/DeclPrinter.cpp
Ted Kremenek
kremenek at apple.com
Fri Sep 17 16:04:38 PDT 2010
Author: kremenek
Date: Fri Sep 17 18:04:38 2010
New Revision: 114235
URL: http://llvm.org/viewvc/llvm-project?rev=114235&view=rev
Log:
Tweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.
Modified:
cfe/trunk/lib/AST/DeclPrinter.cpp
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=114235&r1=114234&r2=114235&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Fri Sep 17 18:04:38 2010
@@ -521,8 +521,11 @@
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 << ")";
More information about the cfe-commits
mailing list