[PATCH] D129488: [Sema] Fix evaluation context of immediate functions in default arguments

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 09:49:20 PDT 2022


ilya-biryukov added a comment.

TODO: add example from cpprefence to the tests:

  consteval int f() { return 42; }
  consteval auto g() { return &f; }
  consteval int h(int (*p)() = g()) { return p(); }
  constexpr int r = h();  // OK
  constexpr auto e = g(); // ill-formed: a pointer to an immediate function is
                          // not a permitted result of a constant expression


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129488



More information about the cfe-commits mailing list