OSDN Git Service

2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / expr / unary2.C
1 // { dg-do compile }
2 // Unary plus/minus are not lvalues.
3
4 // In templates we require an instantiation to emit the diagnostic. This
5 //  is wrong and it is PR 18474.
6
7 int n;
8
9 void f(void)
10 {
11   -n = 0;        // { dg-error "lvalue" }
12   +n = 0;        // { dg-error "lvalue" }
13 }
14
15 template <int>
16 void g(void)
17 {
18   -n = 0;        // { dg-error "lvalue" "" { xfail *-*-* } }
19   +n = 0;        // { dg-error "lvalue" "" { xfail *-*-* } }
20 }