Files
clang-p2996/lldb/test/API/lang/objc/warnings-in-expr-parser/main.m
Raphael Isemann 19b4d3ce27 [lldb] Don't emit a warning when using Objective-C getters in expressions
Clang emits a warning when accessing an Objective-C getter but not using the result.
This gets triggered when just trying to print a getter value in the expression parser (where
Clang just sees a normal expression like `obj.getter` while parsing).

This patch just disables the warning in the expression parser (similar to what we do with
the C++ equivalent of just accessing a member variable but not doing anything with it).

Reviewed By: kastiglione

Differential Revision: https://reviews.llvm.org/D94307
2021-02-11 16:48:41 +01:00

16 lines
210 B
Objective-C

#include <Foundation/Foundation.h>
@interface MyClass : NSObject
@property int m;
@end
@implementation MyClass {
}
@end
int main() {
MyClass *m = [[MyClass alloc] init];
m.m;
return 0; // break here
}