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>();
