mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-25 14:28:54 -04:00

This patch adds the noderef attribute in clang and checks for dereferences of types that have this attribute. This attribute is currently used by sparse and would like to be ported to clang. Differential Revision: https://reviews.llvm.org/D49511 llvm-svn: 348442
12 lines
239 B
Objective-C
12 lines
239 B
Objective-C
// RUN: %clang_cc1 -verify %s
|
|
|
|
#define NODEREF __attribute__((noderef))
|
|
|
|
@interface NSObject
|
|
+ (id)new;
|
|
@end
|
|
|
|
void func() {
|
|
id NODEREF obj = [NSObject new]; // expected-warning{{'noderef' can only be used on an array or pointer type}}
|
|
}
|