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 @@ -5726,7 +5726,10 @@ class ConceptInfo {
57265726QualType getApproximateType (const Expr *E, HeuristicResolver &Resolver) {
57275727 if (E->getType ().isNull ())
57285728 return QualType ();
5729- E = E->IgnoreParenImpCasts ();
5729+ // Don't drop implicit cast if it's an array decay.
5730+ if (auto *ICE = dyn_cast<ImplicitCastExpr>(E);
5731+ !ICE || ICE->getCastKind () != CK_ArrayToPointerDecay)
5732+ E = E->IgnoreParenImpCasts ();
57305733 QualType Unresolved = E->getType ();
57315734 // Resolve DependentNameType
57325735 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