summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/debug-info-template-member.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-05-02 17:45:54 +0000
committerReid Kleckner <rnk@google.com>2019-05-02 17:45:54 +0000
commit2dbd5d84ec9b6df00706af364c3a2650f2d1325c (patch)
treeae34a006c8b6e7a68009744e6dd89cd8851fac6e /clang/test/CodeGenCXX/debug-info-template-member.cpp
parent223ed705d0d3c3b07f00202a04447df836c05df8 (diff)
downloadbcm5719-llvm-2dbd5d84ec9b6df00706af364c3a2650f2d1325c.tar.gz
bcm5719-llvm-2dbd5d84ec9b6df00706af364c3a2650f2d1325c.zip
Use primary template parameter names for variable template debug info
Summary: Fixes PR41677 Consider: template <typename LHS, typename RHS> constexpr bool is_same_v = false; template <typename T> constexpr bool is_same_v<T, T> = true; template constexpr bool is_same_v<int, int>; Before this change, when emitting debug info for the `is_same_v<int, int>` 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
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-template-member.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-template-member.cpp2
1 files changed, 1 insertions, 1 deletions
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]+}}
OpenPOWER on IntegriCloud