Fix a -ast-dump crash.
authorEli Friedman <eli.friedman@gmail.com>
Wed, 8 Aug 2012 03:47:15 +0000 (03:47 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 8 Aug 2012 03:47:15 +0000 (03:47 +0000)
llvm-svn: 161472

clang/lib/AST/DeclPrinter.cpp

index fe8f829..8e00e5a 100644 (file)
@@ -114,6 +114,8 @@ static QualType GetBaseType(QualType T) {
       BaseType = FTy->getResultType();
     else if (const VectorType *VTy = BaseType->getAs<VectorType>())
       BaseType = VTy->getElementType();
+    else if (const ReferenceType *RTy = BaseType->getAs<ReferenceType>())
+      BaseType = RTy->getPointeeType();
     else
       llvm_unreachable("Unknown declarator!");
   }