[PATCH] D70537: [clang] CGDebugInfo asserts `!DT.isNull()` when compiling with debug symbols
kamlesh kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 17:05:37 PST 2019
kamleshbhalui updated this revision to Diff 230569.
kamleshbhalui added a comment.
Added a test.
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,18 @@
+// RUN: %clang %s -S -emit-llvm -g -o - -std=c++17
+// expected-no-diagnostics
+
+struct TypeId
+{
+ inline static int counter{};
+
+ template<typename...>
+ inline static const auto identifier = counter++;
+
+ template<typename... Args>
+ inline static const auto 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,9 @@
if (isa<VarTemplatePartialSpecializationDecl>(V))
continue;
+ if (isa<VarTemplateSpecializationDecl>(V))
+ 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.230569.patch
Type: text/x-patch
Size: 1107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191122/752d1620/attachment-0001.bin>
More information about the cfe-commits
mailing list