Commit 8bcebc69 by Paolo Carlini Committed by Paolo Carlini

re PR c++/33208 (Broken diagnostic: 'component_ref' not supported by dump_decl)

/cp
2007-09-02  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33208
	* typeck.c (build_unary_op): Fix error message for
	Boolean expression as operand to operator--.

/testsuite
2007-09-02  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33208
	* g++.dg/other/error18.C: New.
	* g++.dg/expr/bitfield3.C: Adjust.

From-SVN: r128025
parent 66914102
2007-09-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33208
* typeck.c (build_unary_op): Fix error message for
Boolean expression as operand to operator--.
2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* tree.c (pod_type_p, zero_init_p): Use strip_array_types. * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
......
...@@ -4323,7 +4323,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) ...@@ -4323,7 +4323,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
{ {
if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR) if (code == POSTDECREMENT_EXPR || code == PREDECREMENT_EXPR)
{ {
error ("invalid use of %<--%> on bool variable %qD", arg); error ("invalid use of Boolean expression as operand "
"to %<operator--%>");
return error_mark_node; return error_mark_node;
} }
val = boolean_increment (code, arg); val = boolean_increment (code, arg);
......
2007-09-02 Paolo Carlini <pcarlini@suse.de>
PR c++/33208
* g++.dg/other/error18.C: New.
* g++.dg/expr/bitfield3.C: Adjust.
2007-09-02 H.J. Lu <hongjiu.lu@intel.com> 2007-09-02 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33276 PR fortran/33276
...@@ -7,6 +7,6 @@ struct S { ...@@ -7,6 +7,6 @@ struct S {
S s; S s;
void f() { void f() {
s.x--; // { dg-error "bool" } s.x--; // { dg-error "Boolean expression" }
--s.x; // { dg-error "bool" } --s.x; // { dg-error "Boolean expression" }
} }
// PR c++/33208
struct A
{
bool b;
};
void f(A a)
{
a.b--; // { dg-error "Boolean expression" }
}
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