diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 0608b48f3a88..bf4d26c723d2 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -463,12 +463,12 @@ void DeclPrinter::VisitDeclContext(DeclContext *DC, bool Indent) { else if (isa(*D) && cast(*D)->hasBody()) Terminator = nullptr; else if (auto FD = dyn_cast(*D)) { - if (FD->doesThisDeclarationHaveABody() && !FD->isDefaulted()) + if (FD->isThisDeclarationADefinition()) Terminator = nullptr; else Terminator = ";"; } else if (auto TD = dyn_cast(*D)) { - if (TD->getTemplatedDecl()->doesThisDeclarationHaveABody()) + if (TD->getTemplatedDecl()->isThisDeclarationADefinition()) Terminator = nullptr; else Terminator = ";"; diff --git a/clang/test/AST/ast-print-method-decl.cpp b/clang/test/AST/ast-print-method-decl.cpp index 3c3b8ceaf863..505e07dde1a8 100644 --- a/clang/test/AST/ast-print-method-decl.cpp +++ b/clang/test/AST/ast-print-method-decl.cpp @@ -85,18 +85,3 @@ struct CurlyCtorInit { // CHECK-NEXT: }; }; - - -// CHECK: struct DefMethodsWithoutBody { -struct DefMethodsWithoutBody { - // CHECK-NEXT: DefMethodsWithoutBody() = delete; - DefMethodsWithoutBody() = delete; - - // CHECK-NEXT: DefMethodsWithoutBody() = default; - ~DefMethodsWithoutBody() = default; - - // CHECK-NEXT: void m1() __attribute__((alias("X"))); - void m1() __attribute__((alias("X"))); - - // CHECK-NEXT: }; -};