From eb8a28e2cf033f2bfbfe33a0bd0d9e75a12e2679 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Thu, 8 Apr 2021 17:36:41 -0700 Subject: [PATCH] DebugInfo: Include inline namespaces in template specialization parameter names This ensures these types have distinct names if they are distinct types (eg: if one is an instantiation with a type in one inline namespace, and another from a type with the same simple name, but in a different inline namespace). --- clang/lib/CodeGen/CGDebugInfo.cpp | 1 + clang/test/CodeGenCXX/debug-info-template.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 3fe56346088c..455552a5ea6d 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -305,6 +305,7 @@ StringRef CGDebugInfo::getClassName(const RecordDecl *RD) { llvm::raw_svector_ostream OS(Name); PrintingPolicy PP = getPrintingPolicy(); PP.PrintCanonicalTypes = true; + PP.SuppressInlineNamespace = false; RD->getNameForDiagnostic(OS, PP, /*Qualified*/ false); diff --git a/clang/test/CodeGenCXX/debug-info-template.cpp b/clang/test/CodeGenCXX/debug-info-template.cpp index a6edd59171b2..4342b3e27a0b 100644 --- a/clang/test/CodeGenCXX/debug-info-template.cpp +++ b/clang/test/CodeGenCXX/debug-info-template.cpp @@ -179,3 +179,11 @@ ClassTemplateArgRefTemplate ClassTemplateArgRefObj; // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "ClassTemplateArgRefTemplate<