llvm-project/clang/test/SemaObjC/undef-class-property-error.m
Shoaib Meenai adf5a32ec5 [Sema] Avoid crash for category implementation without interface
When we have a category implementation without a corresponding interface
(which is an error by itself), semantic checks for property accesses
will attempt to access a null interface declaration and then segfault.
Error out in such cases instead.

Differential Revision: https://reviews.llvm.org/D44916

llvm-svn: 328654
2018-03-27 18:58:28 +00:00

10 lines
247 B
Objective-C

// RUN: %clang_cc1 -fsyntax-only -verify %s
@implementation I (C) // expected-error {{cannot find interface declaration for 'I'}}
+ (void)f {
self.m; // expected-error {{member reference base type 'Class' is not a structure or union}}
}
@end