Skip to content

Commit 387e171

Browse files
committed
PR19623: Support typedefs (and alias templates) of void.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207781 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b9351d0 commit 387e171

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/CodeGen/CGDebugInfo.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ llvm::DIType CGDebugInfo::CreateType(const BlockPointerType *Ty,
722722
llvm::DIType CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, llvm::DIFile Unit) {
723723
assert(Ty->isTypeAlias());
724724
llvm::DIType Src = getOrCreateType(Ty->getAliasedType(), Unit);
725-
assert(Src);
726725

727726
SmallString<128> NS;
728727
llvm::raw_svector_ostream OS(NS);
@@ -749,8 +748,6 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty, llvm::DIFile Unit) {
749748
// Typedefs are derived from some other type. If we have a typedef of a
750749
// typedef, make sure to emit the whole chain.
751750
llvm::DIType Src = getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit);
752-
if (!Src)
753-
return llvm::DIType();
754751
// We don't set size information, but do specify where the typedef was
755752
// declared.
756753
SourceLocation Loc = Ty->getDecl()->getLocation();

test/CodeGenCXX/debug-info-alias.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ narf // CHECK: [[NARF]] = {{.*}} ; [ DW_TAG_typedef ] [narf] [line 142
2727
= int;
2828
narf n;
2929

30+
template <typename T>
31+
using tv = void;
32+
// CHECK: null} ; [ DW_TAG_typedef ] [tv<int>] {{.*}} [from ]
33+
tv<int> *tvp;
34+
35+
using v = void;
36+
// CHECK: null} ; [ DW_TAG_typedef ] [v] {{.*}} [from ]
37+
v *vp;

0 commit comments

Comments
 (0)