blob: 464a4cf6c0f17d36aedb771800d0328d2d3aefe9 [file] [log] [blame]
// PR c++/95789
// { dg-do compile { target c++11 } }
struct B {
int n;
};
template <typename T>
struct A {
B& get() const { return f; } // { dg-error "binding reference" }
B f;
};
int main() {
A<int> a;
a.f = {};
a.get().n = 10;
if (a.f.n != 0)
__builtin_abort();
}