Index: cfe/trunk/lib/AST/StmtPrinter.cpp =================================================================== --- cfe/trunk/lib/AST/StmtPrinter.cpp +++ cfe/trunk/lib/AST/StmtPrinter.cpp @@ -1950,7 +1950,10 @@ // Print the body. OS << ' '; - PrintRawCompoundStmt(Node->getBody()); + if (Policy.TerseOutput) + OS << "{}"; + else + PrintRawCompoundStmt(Node->getBody()); } void StmtPrinter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *Node) { Index: cfe/trunk/unittests/AST/StmtPrinterTest.cpp =================================================================== --- cfe/trunk/unittests/AST/StmtPrinterTest.cpp +++ cfe/trunk/unittests/AST/StmtPrinterTest.cpp @@ -231,3 +231,17 @@ ASSERT_TRUE(PrintedStmtObjCMatches(ObjCSource, returnStmt().bind("id"), "return self->ivar;\n")); } + +TEST(StmtPrinter, TerseOutputWithLambdas) { + const char *CPPSource = "auto lamb = []{ return 0; };"; + + // body is printed when TerseOutput is off(default). + ASSERT_TRUE(PrintedStmtCXXMatches(StdVer::CXX11, CPPSource, + lambdaExpr(anything()).bind("id"), + "[] {\n return 0;\n}")); + + // body not printed when TerseOutput is on. + ASSERT_TRUE(PrintedStmtCXXMatches( + StdVer::CXX11, CPPSource, lambdaExpr(anything()).bind("id"), "[] {}", + PolicyAdjusterType([](PrintingPolicy &PP) { PP.TerseOutput = true; }))); +}