forked from OSchip/llvm-project
Improve the printing of C++ construction expressions, from Yuri Gribov!
llvm-svn: 124123
This commit is contained in:
parent
1eb95961d3
commit
baba85dc34
|
@ -1128,14 +1128,15 @@ void StmtPrinter::VisitCXXPseudoDestructorExpr(CXXPseudoDestructorExpr *E) {
|
|||
}
|
||||
|
||||
void StmtPrinter::VisitCXXConstructExpr(CXXConstructExpr *E) {
|
||||
// FIXME. For now we just print a trivial constructor call expression,
|
||||
// constructing its first argument object.
|
||||
if (E->getNumArgs() == 1) {
|
||||
CXXConstructorDecl *CD = E->getConstructor();
|
||||
if (CD->isTrivial())
|
||||
PrintExpr(E->getArg(0));
|
||||
for (unsigned i = 0, e = E->getNumArgs(); i != e; ++i) {
|
||||
if (isa<CXXDefaultArgExpr>(E->getArg(i))) {
|
||||
// Don't print any defaulted arguments
|
||||
break;
|
||||
}
|
||||
|
||||
if (i) OS << ", ";
|
||||
PrintExpr(E->getArg(i));
|
||||
}
|
||||
// Nothing to print.
|
||||
}
|
||||
|
||||
void StmtPrinter::VisitExprWithCleanups(ExprWithCleanups *E) {
|
||||
|
|
Loading…
Reference in New Issue