Patch [3.4/3.3] G++ eliminate use of conditional expressions as lvalues

Joern Rennecke joern.rennecke@superh.com
Thu Apr 3 18:19:00 GMT 2003


Patch fixes:

> 11 ISO C forbids use of conditional expressions as lvalues

`current_binding_level' contains a ?:, so it can't be used as an
lvalue.  I wrote a macro `set_current_binding_level' to use instead.
No real functional change.

I think that is overkill.  All you need to do is apply the
distributive law to the * and ?: operators:

#define current_binding_level                   \
  (*(cfun && cp_function_chain->bindings        \
     ? &cp_function_chain->bindings             \  
     : &scope_chain->bindings))

-- 
--------------------------
SuperH (UK) Ltd.
2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX
T:+44 1454 465658



More information about the Gcc-patches mailing list