http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48483

--- Comment #10 from Lisp2D <lisp2d at lisp2d dot net> 2011-04-07 13:19:16 UTC 
---
(In reply to comment #9)

> No, the variable is in scope after its identifier, so it can be used in the
> initializer expression, e.g.
> 
> int i = sizeof(i);  // ok
> int i = i+1;  // not ok

My opinion is that C habit rules here.

In C

int i=i+1; -> int i; i=i+1;

without constructors, objects e.t.c.
This example will bring just a warning.

In C++

Class i(i.Method()); eval i.Method() -> construct with Class::Class(result)

another order of calculation. (see comment 2) Must be an error.

The answer of question gives the C++ standard. Show me this document.

Reply via email to