Do not evaluate dependent immediate invocations
We deferred the evaluation of dependent immediate invocations in https://reviews.llvm.org/D119375 until instantiation. We should also not consider them referenced from a non-consteval context. Fixes: https://github.com/llvm/llvm-project/issues/55601 ``` template<typename T> class Bar { consteval static T x() { return 5; } public: Bar() : a(x()) {} private: int a; }; Bar<int> g(); ``` Is now accepted by clang. Previously it errored with: `cannot take address of consteval function 'x' outside of an immediate invocation Bar() : a(x()) {}` Differential Revision: https://reviews.llvm.org/D132031
Loading
Please sign in to comment