File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -5740,7 +5740,10 @@ class ConceptInfo {
57405740QualType getApproximateType (const Expr *E, HeuristicResolver &Resolver) {
57415741 if (E->getType ().isNull ())
57425742 return QualType ();
5743- E = E->IgnoreParenImpCasts ();
5743+ // Don't drop implicit cast if it's an array decay.
5744+ if (auto *ICE = dyn_cast<ImplicitCastExpr>(E);
5745+ !ICE || ICE->getCastKind () != CK_ArrayToPointerDecay)
5746+ E = E->IgnoreParenImpCasts ();
57445747 QualType Unresolved = E->getType ();
57455748 // Resolve DependentNameType
57465749 if (const auto *DNT = Unresolved->getAs <DependentNameType>()) {
Original file line number Diff line number Diff line change @@ -36,3 +36,12 @@ void test4(struct Point *p) {
3636}
3737// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):13 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
3838// RUN: %clang_cc1 -fsyntax-only -code-completion-with-fixits -code-completion-at=%s:%(line-3):23 %s -o - | FileCheck -check-prefix=CHECK-CC1 %s
39+
40+ float test5 (void ) {
41+ struct Point array [4 ];
42+ return array -> x ;
43+ }
44+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:%(line-2):17 %s -o - | FileCheck -check-prefix=CHECK-CC4 %s
45+ // CHECK-CC4: COMPLETION: x : [#float#]x
46+ // CHECK-CC4: COMPLETION: y : [#float#]y
47+ // CHECK-CC4: COMPLETION: z : [#float#]z
You can’t perform that action at this time.
0 commit comments