hubert.reinterpretcast added a comment.

Noting for myself:
Clang's status quo already has behaviours that are similar to P2242R3 in its 
C++20 mode despite those behaviours being non-conforming and contributing to 
binary compat breakage with GCC.
This patch is not responsible for those behaviours, and fixing that status quo 
is not within the scope of this patch.

Shorter test:

  struct NonLit {
    NonLit();
  };
  template <typename T>
  constexpr int foo() {
    return 42;
    T t;
  }
  int (*f())() {
    const int x = foo<NonLit>();
    auto ff = [] { return x; }; // C++20 should error here; x is odr-used and 
not captured
    return ff;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111400

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

Reply via email to