1 // PR c++/95789 2 // { dg-do compile { target c++11 } } 3 4 struct B { 5 int n; 6 }; 7 8 template <typename T> 9 struct A { getA10 B& get() const { return f; } // { dg-error "binding reference" } 11 12 B f; 13 }; 14 main()15int main() { 16 A<int> a; 17 a.f = {}; 18 19 a.get().n = 10; 20 if (a.f.n != 0) 21 __builtin_abort(); 22 } 23