[PATCH] D159126: [Clang] Add captures to the instantiation scope of lambda call operators

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 00:54:11 PDT 2023


cor3ntin added a comment.

@abrachet Thanks, i've reverted the patch while i investigate a fix

I managed to reduced it to

  template <class b>
  concept cs = requires(b bj) {
    bj.begin();
  };
  struct {
    template <class b>
    requires cs<b>
    auto operator()(b &&) {}
  } begin;
  template <class>
  concept cu = requires {
    begin;
  };
  template <class b>
  concept cy = requires(b bj) {
    begin(bj);
  };
  struct {
    template <cy b> void operator()(b &&);
  } cz;
  template <cu d> class dc {
    d dd;
  
  public:
    void cz() const requires requires { cz(dd); };
  };
  
  template <class de>
  concept e = requires(de f) {
    f.cz();
  };
  void g() {
    struct dg {
      void begin();
    };
    using dh = dc<dg>;
    static_assert(!e<dh>);
  }

The changes to clang/lib/Sema/TreeTransform.h are what cause the issue


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159126



More information about the cfe-commits mailing list