Incorrect C++ code or regression?

Giovanni Bajo rasky@develer.com
Mon Jan 24 16:50:00 GMT 2005


Grumble <devnull@kma.eu.org> wrote:

> I've tried to make a testcase from the original code.
> GCC 3.3.5 compiles with no warning, while GCC 3.4.3 rejects it.
> Can somebody tell me if it because the code is illegal, and GCC 3.4.3's
> stricter parser now rejects it, or is it some kind of regression?

http://gcc.gnu.org/gcc-3.4/changes.html
As a matter of fact, fixing applications to compile with 3.4 could be very
hard, and require at least some basic understanding of C++ and templates.

> template <class WHIRL>
> void
> WN_TREE_ITER<PRE_ORDER, WHIRL>::WN_TREE_next ()
> {
>    if (_wn == 0) return;
> }


Bug here, use this->_wn instead.
-- 
Giovanni Bajo



More information about the Gcc mailing list