llvm-project/clang/test/CodeCompletion/objc-member-access.m
David Goldman 2ef65adb6f [Sema][CodeComplete][ObjC] Don't include arrow/dot fixits
Summary:
Exempt ObjC from arrow/dot fixits since this has limited value for
Objective-C, where properties (referenced by dot syntax) are normally
backed by ivars (referenced by arrow syntax).

In addition, the current implementation doesn't properly mark
the fix it condition for Objective-C.

This was initially added in https://reviews.llvm.org/D41537
for C++ and then later C, don't believe the Objective-C changes
were intentional.

Reviewers: sammccall, yvvan

Subscribers: jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81263
2020-06-08 12:46:00 -04:00

23 lines
629 B
Objective-C

// Note: the run lines follow their respective tests, since line/column
// matter in this test.
@interface TypeWithPropertiesBackedByIvars {
int _bar;
int _foo;
}
@property(nonatomic) int foo;
@property(nonatomic) int bar;
@end
int getFoo(id object) {
TypeWithPropertiesBackedByIvars *model = (TypeWithPropertiesBackedByIvars *)object;
int foo = model.;
return foo;
}
// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:14:19 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
// CHECK-CC1-NOT: [#int#]_bar
// CHECK-CC1-NOT: [#int#]_foo
// CHECK-CC1: [#int#]bar
// CHECK-CC1: [#int#]foo