Boxed expressions in a template context may have a null method decl. If so,
don't try to access the selector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272318
91177308-0d34-0410-b5e6-
96231b3b80d8
void ASTDumper::VisitObjCBoxedExpr(const ObjCBoxedExpr *Node) {
VisitExpr(Node);
- OS << " selector=";
- Node->getBoxingMethod()->getSelector().print(OS);
+ if (auto *BoxingMethod = Node->getBoxingMethod()) {
+ OS << " selector=";
+ BoxingMethod->getSelector().print(OS);
+ }
}
void ASTDumper::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node) {
// CHECK-NEXT: CXXConstructExpr
// CHECK-NEXT: ObjCIvarDecl{{.*}} X
// CHECK-NEXT: ObjCMethodDecl{{.*}} foo
+
+// @() boxing expressions.
+template <typename T>
+struct BoxingTest {
+ static id box(T value) {
+ return @(value);
+ }
+};
+
+// CHECK: ObjCBoxedExpr{{.*}} '<dependent type>'{{$}}