]> granicus.if.org Git - clang/commitdiff
PR19623: Support typedefs (and alias templates) of void.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 1 May 2014 18:25:19 +0000 (18:25 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 1 May 2014 18:25:19 +0000 (18:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207781 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
test/CodeGenCXX/debug-info-alias.cpp

index 86e76daf0f468882b6de06cbe07694b133b798b7..f41fac80a273eafc60dd86477bdf1332f3184c87 100644 (file)
@@ -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();
index d294a0b0733aada5f5b568efa1d9ceccd35f5226..fb18ac5da006667107a7f6c5e3d72d4aaad8d8c4 100644 (file)
@@ -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;