[DeclPrinter] Don't crash when printing a using decl with a special name

Fixes PR24872.

llvm-svn: 248376
This commit is contained in:
Benjamin Kramer 2015-09-23 13:43:16 +00:00
parent a3e553a22c
commit 36d514e687
2 changed files with 9 additions and 1 deletions

View File

@ -1299,7 +1299,7 @@ void DeclPrinter::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) {
if (!D->isAccessDeclaration())
Out << "using ";
D->getQualifier()->print(Out, Policy);
Out << D->getName();
Out << D->getDeclName();
}
void DeclPrinter::VisitUsingShadowDecl(UsingShadowDecl *D) {

View File

@ -219,3 +219,11 @@ struct CXXFunctionalCastExprPrint {} fce = CXXFunctionalCastExprPrint{};
// CHECK: struct CXXTemporaryObjectExprPrint toe = CXXTemporaryObjectExprPrint{};
struct CXXTemporaryObjectExprPrint { CXXTemporaryObjectExprPrint(); } toe = CXXTemporaryObjectExprPrint{};
namespace PR24872 {
// CHECK: template <typename T> struct Foo : T {
// CHECK: using T::operator-;
template <typename T> struct Foo : T {
using T::operator-;
};
}