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 20
20
#include " clang/AST/ExprConcepts.h"
21
21
#include " clang/AST/ExprObjC.h"
22
22
#include " clang/AST/NestedNameSpecifier.h"
23
+ #include " clang/AST/OperationKinds.h"
23
24
#include " clang/AST/QualTypeNames.h"
24
25
#include " clang/AST/RecursiveASTVisitor.h"
25
26
#include " clang/AST/Type.h"
@@ -5678,6 +5679,10 @@ QualType getApproximateType(const Expr *E) {
5678
5679
return getApproximateType (VD->getInit ());
5679
5680
}
5680
5681
}
5682
+ if (const auto *UO = llvm::dyn_cast<UnaryOperator>(E)) {
5683
+ if (UO->getOpcode () == UnaryOperatorKind::UO_Deref)
5684
+ return UO->getSubExpr ()->getType ()->getPointeeType ();
5685
+ }
5681
5686
return Unresolved;
5682
5687
}
5683
5688
Original file line number Diff line number Diff line change @@ -348,7 +348,23 @@ namespace function_can_be_call {
348
348
T foo (U, V);
349
349
};
350
350
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
353
355
// CHECK_FUNCTION_CAN_BE_CALL: COMPLETION: foo : [#T#]foo<<#typename T#>, <#typename U#>>(<#U#>, <#V#>)
354
356
}
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