From 2dbd5d84ec9b6df00706af364c3a2650f2d1325c Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 2 May 2019 17:45:54 +0000 Subject: Use primary template parameter names for variable template debug info Summary: Fixes PR41677 Consider: template constexpr bool is_same_v = false; template constexpr bool is_same_v = true; template constexpr bool is_same_v; Before this change, when emitting debug info for the `is_same_v` global variable, clang would crash because it would try to use the template parameter list from the partial specialization to give parameter names to template arguments. This doesn't work in general, since a partial specialization can have fewer arguments than the primary template. Therefore, always use the primary template. Hypothetically we could try to use the parameter names from the partial specialization when possible, but it's not clear this really helps debugging in practice. Reviewers: JDevlieghere, aprantl, ormris, dblaikie Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61408 llvm-svn: 359809 --- clang/test/CodeGenCXX/debug-info-template-member.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/CodeGenCXX/debug-info-template-member.cpp') diff --git a/clang/test/CodeGenCXX/debug-info-template-member.cpp b/clang/test/CodeGenCXX/debug-info-template-member.cpp index db6006cab82..3d5b04d1641 100644 --- a/clang/test/CodeGenCXX/debug-info-template-member.cpp +++ b/clang/test/CodeGenCXX/debug-info-template-member.cpp @@ -30,7 +30,7 @@ inline int add3(int x) { // CHECK: {{![0-9]+}} = distinct !DIGlobalVariable( // CHECK-SAME: name: "var" // CHECK-SAME: templateParams: {{![0-9]+}} -// CHECK: !DITemplateTypeParameter(name: "P", type: {{![0-9]+}}) +// CHECK: !DITemplateTypeParameter(name: "T", type: {{![0-9]+}}) // CHECK: {{![0-9]+}} = distinct !DIGlobalVariable( // CHECK-SAME: name: "varray" // CHECK-SAME: templateParams: {{![0-9]+}} -- cgit v1.2.3