aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/DeclPrinter.cpp2
-rw-r--r--unittests/AST/DeclPrinterTest.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index a5e1378b46..f277f1fac7 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -565,6 +565,8 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
Out << " = 0";
else if (D->isDeletedAsWritten())
Out << " = delete";
+ else if (D->isExplicitlyDefaulted())
+ Out << " = default";
else if (D->doesThisDeclarationHaveABody() && !Policy.TerseOutput) {
if (!D->hasPrototype() && D->getNumParams()) {
// This is a K&R function definition, so we need to print the
diff --git a/unittests/AST/DeclPrinterTest.cpp b/unittests/AST/DeclPrinterTest.cpp
index 2cb3a3f748..50aab03212 100644
--- a/unittests/AST/DeclPrinterTest.cpp
+++ b/unittests/AST/DeclPrinterTest.cpp
@@ -476,8 +476,8 @@ TEST(DeclPrinter, TestCXXConstructorDecl8) {
" A() = default;"
"};",
constructorDecl(ofClass(hasName("A"))).bind("id"),
- "A() noexcept"));
- // WRONG; Should be: "A() = default;"
+ "A() noexcept = default"));
+ // Should be: "A() = default;" if we care about noexcept as written
}
TEST(DeclPrinter, TestCXXConstructorDecl9) {