gcc/testsuite/g++.dg/template/nontype11.C
raw| 1 | // { dg-do compile } |
| 2 | // Origin: <fsm at robots dot ox dot ac dot uk> |
| 3 | // PR c++/18354: Unary plus should not be wrapped in NON_LVALUE_EXPR |
| 4 | |
| 5 | template <int N> |
| 6 | struct X { }; |
| 7 | |
| 8 | const int n = 1; |
| 9 | |
| 10 | void f() |
| 11 | { |
| 12 | X< 1> a; |
| 13 | X<-1> b; |
| 14 | X<+1> c; |
| 15 | } |
| 16 | |
| 17 | void g() |
| 18 | { |
| 19 | X< n> a; |
| 20 | X<-n> b; |
| 21 | X<+n> c; |
| 22 | } |