mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 17:16:42 +00:00

This expands very slightly what -Wtautological-compare considers to be tautological to include implicit accesses to C++ fields and ObjC ivars. I don't want to turn this into a full expression-identity check, but these additions seem pretty well-contained, and maintain the theme of checking for "x == x". <rdar://problem/14431127> llvm-svn: 190118
13 lines
232 B
Objective-C
13 lines
232 B
Objective-C
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
|
|
|
@interface A {
|
|
id xxx;
|
|
}
|
|
-(int)bar;
|
|
@end
|
|
@implementation A
|
|
-(int)bar {
|
|
return xxx == xxx; // expected-warning {{self-comparison always evaluates to true}}
|
|
}
|
|
@end
|