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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290881
91177308-0d34-0410-b5e6-
96231b3b80d8
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");
};
struct FriendedStruct { };
+
+// Using declaration
+namespace provider {
+ void foo();
+}
+namespace user {
+ using provider::foo;
+}