Skip to content

Commit

Permalink
DebugInfo: STN: Handle unreconstitutable types in function types
Browse files Browse the repository at this point in the history
  • Loading branch information
dwblaikie committed Sep 24, 2021
1 parent e70082e commit 8d9ddd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4881,7 +4881,7 @@ struct ReconstitutableType : public RecursiveASTVisitor<ReconstitutableType> {
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
Expand Down
2 changes: 2 additions & 0 deletions clang/test/CodeGenCXX/debug-info-simple-template-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ void f() {
} unnamed_struct;
f1<decltype(unnamed_struct)>();
// CHECK: !DISubprogram(name: "f1<(unnamed struct at {{.*}}debug-info-simple-template-names.cpp:[[# @LINE - 3]]:3)>",
f1<void (decltype(unnamed_struct))>();
// CHECK: !DISubprogram(name: "f1<void ((unnamed struct at {{.*}}CodeGenCXX/debug-info-simple-template-names.cpp:[[# @LINE - 5]]:3))>",
enum {} unnamed_enum;
f1<decltype(unnamed_enum)>();
// CHECK: !DISubprogram(name: "f1<(unnamed enum at {{.*}}debug-info-simple-template-names.cpp:[[# @LINE - 2]]:3)>",
Expand Down

0 comments on commit 8d9ddd4

Please sign in to comment.