diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index eb3f104f7eb9..d8ba5592ad47 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -5040,6 +5040,10 @@ struct ReconstitutableType : public RecursiveASTVisitor { Reconstitutable = false; return false; } + if (!ED->isExternallyVisible()) { + Reconstitutable = false; + return false; + } } return true; } diff --git a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp index 344bd93020f6..06e83ea6f59e 100644 --- a/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp +++ b/clang/test/CodeGenCXX/debug-info-simple-template-names.cpp @@ -16,6 +16,17 @@ struct t2 { }; template