[PATCH] D112453: [Sema] When dereferencing a pointer of dependent type, infer the result type.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 2 09:21:03 PDT 2021


aaron.ballman added a comment.

In D112453#3084394 <https://reviews.llvm.org/D112453#3084394>, @courbet wrote:

> As per the comment in BuiltinTypes.def (see below), `Dependent` is
> allowed in context where the type is deducible, but is there any reason
> **not** to deduce the type if we can do it cheaply in some cases ?
>
>   // This represents the type of an expression whose type is
>   // totally unknown, e.g. 'T::foo'.  It is permitted for this to
>   // appear in situations where the structure of the type is
>   // theoretically deducible.
>   BUILTIN_TYPE(Dependent, DependentTy)

I've been trying to think if this will cause problems or not, and I'm not convinced one way or the other. I was thinking that if we resolve the type to a non-dependent type, but it is used within another type (making the second type also dependent), won't we change the point of instantiation for that second dependent type?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112453



More information about the cfe-commits mailing list