forked from OSchip/llvm-project
Handle UsingDecl and UsingShadowDecl in DeclContextPrinter
This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 llvm-svn: 290881
This commit is contained in:
parent
14abc7f007
commit
1d86ab4d36
|
@ -485,6 +485,14 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
|
|||
Out << "\n";
|
||||
break;
|
||||
}
|
||||
case Decl::Using: {
|
||||
Out << "<using> " << *cast<UsingDecl>(I) << "\n";
|
||||
break;
|
||||
}
|
||||
case Decl::UsingShadow: {
|
||||
Out << "<using shadow> " << *cast<UsingShadowDecl>(I) << "\n";
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Out << "DeclKind: " << DK << '"' << I << "\"\n";
|
||||
llvm_unreachable("decl unhandled");
|
||||
|
|
|
@ -33,3 +33,11 @@ struct FriendlyStruct {
|
|||
};
|
||||
|
||||
struct FriendedStruct { };
|
||||
|
||||
// Using declaration
|
||||
namespace provider {
|
||||
void foo();
|
||||
}
|
||||
namespace user {
|
||||
using provider::foo;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue