Closed
Description
GCC: g++.dg/cpp2a/consteval31.C
struct A {
consteval A operator+() { return {}; }
};
consteval A operator~(A) { return {}; }
consteval A operator+(A, A) { return {}; }
template <class> void f() {
A a;
A b = ~a; // cannot take address of consteval function 'operator~' outside of an immediate invocation
A c = a + a; // similar error
A d = +a; // similar error
}
template void f<int>();
https://godbolt.org/z/MxncM3Yaq
Looks important to fix and a possible blocker to #57094
Metadata
Metadata
Assignees
Type
Projects
Status
Done