sammccall added a comment.

@rsmith: we have two open questions here...

---

1: Expressions whose types are no longer dependent.

In the rare case where RHS is type-dependent and LHS is a known pointer, e.g.

  template <typename Idx>
  int access(int *arr, Idx i) {
    return arr[i];
  }

we're now changing the ArraySubscriptExpr's type from DependentTy to int, while 
keeping the expr type-dependent.

Is this OK, or should we avoid it by artificially requiring LHS specifically to 
be type-dependent to do the refinement?

---

2: LHS vs RHS symmetry.

We only bother to check if **LHS** is a pointer, so 
`type_dependent_pointer[integer]` gets a specific dependent type, while the 
obscure `integer[type_dependent_pointer]` remains DependentTy.

Is this OK, or must we handle the rare case in the same way?

---

Functionally, doing the "safe" thing in both cases seems fine. But I don't want 
to spray unnecessary defensive code around, for maintenance reasons.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107275/new/

https://reviews.llvm.org/D107275

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to