usaxena95 added a comment. Herald added a project: All. Update: The mentioned cases here are all now fixed at head (after D132031 <https://reviews.llvm.org/D132031>)
// 1 consteval int f(int n) { return n; } template <int M> constexpr int broken() { return f(M); } static_assert(broken<100>() == 100); // 2 template <typename T> struct Foo { static consteval void ok(int) {} static consteval void bad(T) {} template <typename U> static consteval void call(T x, U fn) { fn(x); } static constexpr bool test() { ok({}); bad({}); // error: cannot take address of consteval function 'bad' outside of an immediate invocation call({}, bad); // error: cannot take address of consteval function 'bad' outside of an immediate invocation return true; } }; // 3 template <typename T> struct Bar { static consteval void bad(int) {} static constexpr bool test() { bad(T::value); // error: cannot take address of consteval function 'bad' outside of an immediate invocation return true; } }; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113859/new/ https://reviews.llvm.org/D113859 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits