File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 2020#include " clang/AST/ExprConcepts.h"
2121#include " clang/AST/ExprObjC.h"
2222#include " clang/AST/NestedNameSpecifier.h"
23+ #include " clang/AST/OperationKinds.h"
2324#include " clang/AST/QualTypeNames.h"
2425#include " clang/AST/RecursiveASTVisitor.h"
2526#include " clang/AST/Type.h"
@@ -5678,6 +5679,10 @@ QualType getApproximateType(const Expr *E) {
56785679 return getApproximateType (VD->getInit ());
56795680 }
56805681 }
5682+ if (const auto *UO = llvm::dyn_cast<UnaryOperator>(E)) {
5683+ if (UO->getOpcode () == UnaryOperatorKind::UO_Deref)
5684+ return UO->getSubExpr ()->getType ()->getPointeeType ();
5685+ }
56815686 return Unresolved;
56825687}
56835688
Original file line number Diff line number Diff line change @@ -348,7 +348,23 @@ namespace function_can_be_call {
348348 T foo (U, V);
349349 };
350350
351- &S::f
352- // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:351:7 %s -o - | FileCheck -check-prefix=CHECK_FUNCTION_CAN_BE_CALL %s
351+ void test () {
352+ &S::f
353+ }
354+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:352:9 %s -o - | FileCheck -check-prefix=CHECK_FUNCTION_CAN_BE_CALL %s
353355 // CHECK_FUNCTION_CAN_BE_CALL: COMPLETION: foo : [#T#]foo<<#typename T#>, <#typename U#>>(<#U#>, <#V#>)
354356}
357+
358+ namespace deref_dependent_this {
359+ template <typename T>
360+ class A {
361+ int field;
362+
363+ void function () {
364+ (*this ).field ;
365+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:364:13 %s -o - | FileCheck -check-prefix=CHECK-DEREF-THIS %s
366+ // CHECK-DEREF-THIS: field : [#int#]field
367+ // CHECK-DEREF-THIS: [#void#]function()
368+ }
369+ };
370+ }
You can’t perform that action at this time.
0 commit comments