[PATCH] D70537: [clang] CGDebugInfo asserts `!DT.isNull()` when compiling with debug symbols
kamlesh kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 20:38:32 PST 2019
kamleshbhalui updated this revision to Diff 230747.
kamleshbhalui added a comment.
Thanks, @vsk for reviewing.
I have incorporated your suggestions.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70537/new/
https://reviews.llvm.org/D70537
Files:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGenCXX/pr42710.cpp
Index: clang/test/CodeGenCXX/pr42710.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGenCXX/pr42710.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang %s -DTYPE=auto -emit-llvm -S -g -o - -std=c++17
+// expected-no-diagnostics
+// RUN: %clang %s -DTYPE=int -emit-llvm -S -g -o - -std=c++17
+// expected-no-diagnostics
+
+struct TypeId
+{
+ inline static int counter{};
+
+ template<typename...>
+ inline static const TYPE identifier = counter++;
+
+ template<typename... Args>
+ inline static const TYPE value = identifier<Args...>;
+};
+
+int main()
+{
+ return TypeId::value<int>;
+}
Index: clang/lib/CodeGen/CGDebugInfo.cpp
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.cpp
+++ clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1433,6 +1433,10 @@
if (isa<VarTemplatePartialSpecializationDecl>(V))
continue;
+ if (isa<VarTemplateSpecializationDecl>(V) &&
+ V->getType()->isUndeducedType())
+ continue;
+
// Reuse the existing static member declaration if one exists
auto MI = StaticDataMemberCache.find(V->getCanonicalDecl());
if (MI != StaticDataMemberCache.end()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70537.230747.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191123/06cad8de/attachment.bin>
More information about the llvm-commits
mailing list