PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / expr / unary2.C
blob8418815918fb71cf09584f3c9a7a5e48a6bc5e2f
1 // { dg-do compile }
2 // Unary plus/minus are not lvalues.
4 // In templates we require an instantiation to emit the diagnostic. This
5 //  is wrong and it is PR 18474.
7 int n;
9 void f(void)
11   -n = 0;        // { dg-error "lvalue" }
12   +n = 0;        // { dg-error "lvalue" }
15 template <int>
16 void g(void)
18   -n = 0;        // { dg-error "lvalue" "" { xfail *-*-* } }
19   +n = 0;        // { dg-error "lvalue" "" { xfail *-*-* } }