1 // Verify non-dependent assignment expressions are recognized as such
2 // and are checked ahead of time.
4 // { dg-do compile { target c++11 } }
6 struct X { using t1 = int; };
7 struct Y { X operator=(const Y&); } y;
8 template<class T> void f1(decltype(y = y)::t1);
11 template<class T> void f2(decltype(n = n)::t1); // { dg-error "not a class" }
12 template<class T> void f3(decltype(n += n)::t1); // { dg-error "not a class" }
17 n = 42; // { dg-error "read-only" }
20 x = {}; // { dg-error "no match" }
23 y = {}; // { dg-error "no match" }
24 Y{} = X{}; // { dg-error "no match" }