[PATCH] D134772: [Clang] Make constraints of auto part of NTTP instead of AutoType

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 16:58:06 PDT 2022


rsmith added a comment.

I'm somewhat skeptical of this approach, because constrained `auto` can appear in places within the type of an NTTP other than the top level -- for example, in `template<C auto*>`. (Clang is non-conforming and doesn't support this yet, but it will need to do so eventually.) In principle, there could even be multiple different constrained `auto` types within the type of the same NTTP in the future -- I don't think that can happen with the current language rules, but it could happen in the Concepts TS, and it only seems to be happenstance that prevents it in C++20 rather than design intent. Fundamentally, the constraint is not associated with the NTTP and is instead associated with the relevant portion of the NTTP's type. If something in the design of constrained `auto` is meaning that uniquing isn't working properly, maybe there's some way we can address that directly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134772



More information about the cfe-commits mailing list