denis-fatkulin updated this revision to Diff 452408. denis-fatkulin added a comment.
Patch is updated with context 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 @@ -1273,7 +1273,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;
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 @@ -1273,7 +1273,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;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits