forked from OSchip/llvm-project
Don't crash when printing auto variables.
Patch by Axel Naumann! llvm-svn: 274859
This commit is contained in:
parent
c813c8113d
commit
cdaa31fe84
|
@ -132,6 +132,8 @@ static QualType GetBaseType(QualType T) {
|
|||
BaseType = VTy->getElementType();
|
||||
else if (const ReferenceType *RTy = BaseType->getAs<ReferenceType>())
|
||||
BaseType = RTy->getPointeeType();
|
||||
else if (const AutoType *ATy = BaseType->getAs<AutoType>())
|
||||
BaseType = ATy->getDeducedType();
|
||||
else
|
||||
llvm_unreachable("Unknown declarator!");
|
||||
}
|
||||
|
|
|
@ -227,3 +227,12 @@ template <typename T> struct Foo : T {
|
|||
using T::operator-;
|
||||
};
|
||||
}
|
||||
|
||||
namespace dont_crash {
|
||||
struct T { enum E {X = 12ll }; };
|
||||
struct S {
|
||||
struct { int I; } ADecl;
|
||||
static const auto Y = T::X;
|
||||
};
|
||||
//CHECK: static const auto Y = T::X;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue