Commit d6b75f70 by Giovanni Bajo

* g++.dg/expr/unary1.C, g++.dg/expr/unary2.C: New tests.

From-SVN: r90616
parent e34b0922
2004-11-14 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* g++.dg/expr/unary1.C, g++.dg/expr/unary2.C: New tests.
2004-11-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/17344
......
// { dg-do compile }
// Unary plus (but not unary minus) can be applied to pointer types
void *p;
void f(void)
{
-p; // { dg-error "wrong type argument" }
+p;
}
template <int>
void g(void)
{
-p; // { dg-error "wrong type argument" }
+p;
}
// { dg-do compile }
// Unary plus/minus are not lvalues.
// In templates we require an instantiation to emit the diagnostic. This
// is wrong and it is PR 18474.
int n;
void f(void)
{
-n = 0; // { dg-error "non-lvalue" }
+n = 0; // { dg-error "non-lvalue" }
}
template <int>
void g(void)
{
-n = 0; // { dg-error "non-lvalue" "" { xfail *-*-* } }
+n = 0; // { dg-error "non-lvalue" "" { xfail *-*-* } }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment