[Bug c++/97740] [10/11/12/13 Regression] Weird error message about accessing a private member of my own class inside of std::string_view inside of constexpr
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 24 16:10:27 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97740
--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
A C++14 version that's more similar to the original testcase using a generic
lambda and dependent initializer:
struct A {
constexpr const int* get() const { return &m; }
private:
int m = 42;
} a;
struct B { const int* p; };
template<A* arg>
void f() {
[] (auto) {
constexpr B b = {arg->get()};
}(0);
}
template void f<&a>();
More information about the Gcc-bugs
mailing list