From 8d9ddd4f509c54d05a38427d7999c061d88ca35c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 23 Sep 2021 21:13:16 -0700 Subject: [PATCH] DebugInfo: STN: Handle unreconstitutable types in function types --- clang/lib/CodeGen/CGDebugInfo.cpp | 2 +- clang/test/CodeGenCXX/debug-info-simple-template-names.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 7119402dcb64..100ce695f86b 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -4881,7 +4881,7 @@ struct ReconstitutableType : public RecursiveASTVisitor { bool VisitFunctionProtoType(FunctionProtoType *FT) { // noexcept is not encoded in DWARF, so the reversi Reconstitutable &= !isNoexceptExceptionSpec(FT->getExceptionSpecType()); - return !Reconstitutable; + return Reconstitutable; } bool TraverseRecordType(RecordType *RT) { // Unnamed classes/lambdas can't be reconstituted due to a lack of column diff --git a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp index 98109bc93f00..be290b3b97e5 100644 --- a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp +++ b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp @@ -55,6 +55,8 @@ void f() { } unnamed_struct; f1(); // CHECK: !DISubprogram(name: "f1<(unnamed struct at {{.*}}debug-info-simple-template-names.cpp:[[# @LINE - 3]]:3)>", + f1(); + // CHECK: !DISubprogram(name: "f1", enum {} unnamed_enum; f1(); // CHECK: !DISubprogram(name: "f1<(unnamed enum at {{.*}}debug-info-simple-template-names.cpp:[[# @LINE - 2]]:3)>",