Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing on
certain receiver types. llvm-svn: 200953
This commit is contained in:
parent
ccf8e29060
commit
6d92e50263
|
@ -716,9 +716,11 @@ void StmtPrinter::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) {
|
|||
void StmtPrinter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node) {
|
||||
if (Node->isSuperReceiver())
|
||||
OS << "super.";
|
||||
else if (Node->getBase()) {
|
||||
else if (Node->isObjectReceiver() && Node->getBase()) {
|
||||
PrintExpr(Node->getBase());
|
||||
OS << ".";
|
||||
} else if (Node->isClassReceiver() && Node->getClassReceiver()) {
|
||||
OS << Node->getClassReceiver()->getName() << ".";
|
||||
}
|
||||
|
||||
if (Node->isImplicitProperty())
|
||||
|
|
|
@ -134,3 +134,12 @@ void TestBlockDecl(int x) {
|
|||
// CHECK-NEXT: ...
|
||||
// CHECK-NEXT: capture ParmVar{{.*}} 'x' 'int'
|
||||
// CHECK-NEXT: CompoundStmt
|
||||
|
||||
@interface B
|
||||
+ (int) foo;
|
||||
@end
|
||||
|
||||
void f() {
|
||||
__typeof__(B.foo) Test;
|
||||
}
|
||||
// CHECK: VarDecl{{.*}}Test 'typeof (B.foo)':'int'
|
||||
|
|
Loading…
Reference in New Issue