diff options
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 3 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-var-template-partial-spec.cpp | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index af9bac9b388..a53ca8f5243 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1410,6 +1410,9 @@ void CGDebugInfo::CollectRecordFields( isa<VarTemplateSpecializationDecl>(V)) continue; + if (isa<VarTemplatePartialSpecializationDecl>(V)) + continue; + // Reuse the existing static member declaration if one exists auto MI = StaticDataMemberCache.find(V->getCanonicalDecl()); if (MI != StaticDataMemberCache.end()) { diff --git a/clang/test/CodeGenCXX/debug-info-var-template-partial-spec.cpp b/clang/test/CodeGenCXX/debug-info-var-template-partial-spec.cpp new file mode 100644 index 00000000000..675e3282371 --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-var-template-partial-spec.cpp @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 %s -std=c++14 -debug-info-kind=limited -emit-llvm -o - | FileCheck %s + +// CHECK: ![[empty:[0-9]+]] = !{} + +// CHECK: distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", +// CHECK-SAME: elements: ![[empty]] + +struct B { + template <typename... e> + static const int d = 0; + template <typename e> + static const auto d<e> = d<e, e>; +} c; |

