Skip to content
Snippets Groups Projects
Commit 3198ed99 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Change declaration treatment to mimic C++

Actually in C++
``
double x = 3;
{
  double x = x+1;
}
``
in the instruction, ``double x = x+1;``, the right-hand side `x` IS the
left-hand side and not the global one, which lead to a "use of non-initialized"
warning.

It is not clear to me why the RHS x is not the global one, and I think the
previous implementation was a possibility. One just can say that the chosen C++
policy implies that the above code is equivalent to
``
double x = 3;
{
  double x; x = x+1;
}
``
which was not the case for the previous pugs implementation, and that `x` is
found in the local symbol table as soon as it is declared (right after the `=`
symbol)
parent cbbf958d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment