summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
-rw-r--r--clang/test/CodeGenCXX/debug-info-alias.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 86e76daf0f4..f41fac80a27 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -722,7 +722,6 @@ llvm::DIType CGDebugInfo::CreateType(const BlockPointerType *Ty,
llvm::DIType CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, llvm::DIFile Unit) {
assert(Ty->isTypeAlias());
llvm::DIType Src = getOrCreateType(Ty->getAliasedType(), Unit);
- assert(Src);
SmallString<128> NS;
llvm::raw_svector_ostream OS(NS);
@@ -749,8 +748,6 @@ llvm::DIType CGDebugInfo::CreateType(const TypedefType *Ty, llvm::DIFile Unit) {
// Typedefs are derived from some other type. If we have a typedef of a
// typedef, make sure to emit the whole chain.
llvm::DIType Src = getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit);
- if (!Src)
- return llvm::DIType();
// We don't set size information, but do specify where the typedef was
// declared.
SourceLocation Loc = Ty->getDecl()->getLocation();
diff --git a/clang/test/CodeGenCXX/debug-info-alias.cpp b/clang/test/CodeGenCXX/debug-info-alias.cpp
index d294a0b0733..fb18ac5da00 100644
--- a/clang/test/CodeGenCXX/debug-info-alias.cpp
+++ b/clang/test/CodeGenCXX/debug-info-alias.cpp
@@ -27,3 +27,11 @@ narf // CHECK: [[NARF]] = {{.*}} ; [ DW_TAG_typedef ] [narf] [line 142
= int;
narf n;
+template <typename T>
+using tv = void;
+// CHECK: null} ; [ DW_TAG_typedef ] [tv<int>] {{.*}} [from ]
+tv<int> *tvp;
+
+using v = void;
+// CHECK: null} ; [ DW_TAG_typedef ] [v] {{.*}} [from ]
+v *vp;
OpenPOWER on IntegriCloud