[PATCH] D140996: [c++20] P1907R1: Support for generalized non-type template arguments of scalar type.

Andrey Ali Khan Bolshakov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 23:14:14 PST 2023


bolshakov-a added a comment.

@aaron.ballman, @rsmith, @mizvekov, @shafik,  has the mankind any chance to get this reviewed and merged?

Btw, FYI, I've investigated the Chromium compilation crash that caused the rollback in 8ba442bc2136 <https://reviews.llvm.org/rG8ba442bc2136c9ab91c74826db7195e406b94fb7> and have succeeded in obtaining a smaller reproducer:

  void fn() {
    auto L = [i = 5](auto) -> decltype(auto) { return i; };
    L(2);
  }

After 5a391d38ac6c <https://reviews.llvm.org/rG5a391d38ac6c561ba908334d427f26124ed9132e>, `DeclRefExpr` in lambda `return` statement referring to `i` becomes instantiation dependent because decl context of `i` declaration occurs to be the templated lambda `operator()` and not the lambda implicit (non-templated) class (which seems to be wrong). Then, after da986511fb9da1a <https://reviews.llvm.org/rGda986511fb9da1a46a0ca4dba2e49e2426036303>, that dependence flag started to propagate through `DecltypeType`, and `L(2)` call result type becomes "dependent", which, of course, should not occur.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140996



More information about the cfe-commits mailing list