[PATCH] D131088: [clang] Apply FixIts to members declared via `using` in derived classes
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 17 01:13:44 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8837ef4d373b: [clang] Apply FixIts to members declared via `using` in derived classes (authored by denis-fatkulin, committed by kadircet).
Changed prior to commit:
https://reviews.llvm.org/D131088?vs=452408&id=453227#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131088/new/
https://reviews.llvm.org/D131088
Files:
clang/lib/Sema/SemaCodeComplete.cpp
clang/test/CodeCompletion/member-access.cpp
Index: clang/test/CodeCompletion/member-access.cpp
===================================================================
--- clang/test/CodeCompletion/member-access.cpp
+++ clang/test/CodeCompletion/member-access.cpp
@@ -311,3 +311,25 @@
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:310:19 %s -o - | FileCheck -check-prefix=CHECK-MEMBERS-FROM-BASE-DEPENDENT %s
// CHECK-MEMBERS-FROM-BASE-DEPENDENT: [#Base4#]base4
}
+
+namespace members_using_fixits {
+ struct Bar {
+ void method();
+ int field;
+ };
+ struct Baz: Bar {
+ using Bar::method;
+ using Bar::field;
+ };
+ void testMethod(Baz* ptr) {
+ ptr.m
+ }
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:325:10 %s -o - | FileCheck -check-prefix=CHECK-METHOD-DECLARED-VIA-USING %s
+ // CHECK-METHOD-DECLARED-VIA-USING: [#void#]method() (requires fix-it: {325:8-325:9} to "->")
+
+ void testField(Baz* ptr) {
+ ptr.f
+ }
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:331:10 %s -o - | FileCheck -check-prefix=CHECK-FIELD-DECLARED-VIA-USING %s
+ // CHECK-FIELD-DECLARED-VIA-USING: [#int#]field (requires fix-it: {331:8-331:9} to "->")
+}
Index: clang/lib/Sema/SemaCodeComplete.cpp
===================================================================
--- clang/lib/Sema/SemaCodeComplete.cpp
+++ clang/lib/Sema/SemaCodeComplete.cpp
@@ -1098,7 +1098,8 @@
getBasePriority(Using->getTargetDecl()),
R.Qualifier, false,
(R.Availability == CXAvailability_Available ||
- R.Availability == CXAvailability_Deprecated));
+ R.Availability == CXAvailability_Deprecated),
+ std::move(R.FixIts));
Result.ShadowDecl = Using;
MaybeAddResult(Result, CurContext);
return;
@@ -1273,7 +1274,8 @@
getBasePriority(Using->getTargetDecl()),
R.Qualifier, false,
(R.Availability == CXAvailability_Available ||
- R.Availability == CXAvailability_Deprecated));
+ R.Availability == CXAvailability_Deprecated),
+ std::move(R.FixIts));
Result.ShadowDecl = Using;
AddResult(Result, CurContext, Hiding);
return;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131088.453227.patch
Type: text/x-patch
Size: 2470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220817/f9a47653/attachment-0001.bin>
More information about the cfe-commits
mailing list