summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/undef-class-property-error.m
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-03-27 18:58:28 +0000
committerShoaib Meenai <smeenai@fb.com>2018-03-27 18:58:28 +0000
commitadf5a32ec57addb326ff6cd13f1e9e0a6a10bdb8 (patch)
treedacb579967b152f1f1938186a4801906f82254b7 /clang/test/SemaObjC/undef-class-property-error.m
parent662f38b16f0ef69e0e55a0662d2fe68413e1e465 (diff)
downloadbcm5719-llvm-adf5a32ec57addb326ff6cd13f1e9e0a6a10bdb8.tar.gz
bcm5719-llvm-adf5a32ec57addb326ff6cd13f1e9e0a6a10bdb8.zip
[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
Diffstat (limited to 'clang/test/SemaObjC/undef-class-property-error.m')
-rw-r--r--clang/test/SemaObjC/undef-class-property-error.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/undef-class-property-error.m b/clang/test/SemaObjC/undef-class-property-error.m
new file mode 100644
index 00000000000..e7e5db41efb
--- /dev/null
+++ b/clang/test/SemaObjC/undef-class-property-error.m
@@ -0,0 +1,9 @@
+// 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
OpenPOWER on IntegriCloud