[LC++]Compiles with g++-3.2 but later versions flakey. Why?

Chris Vine chris at cvine.freeserve.co.uk
Wed Oct 26 03:56:01 UTC 2005


On Tuesday 25 October 2005 08:15, Dr Mark H Phillips wrote:
> Hi,
>
> I've attached some test code below.  It compiles fine with
> g++ version 3.2.3, but fails for later versions.  The strange
> thing is that different versions fail in different cases.  Have
> I uncovered genuine compiler bugs, or is there something else
> going on?
>
> Here's the errors I'm getting:
> $ g++-3.3 testit.cc
> testit.cc: In function `int main()':
> testit.cc:22: error: `dummyx::dummyFunct' cannot be used as a function
> $ g++-3.4 testit.cc
> testit.cc: In function `int main()':
> testit.cc:23: error: `dummyx::dummyFunct' cannot be used as a function
> $ g++-4.0 testit.cc
> testit.cc: In function ‘int main()’:
> testit.cc:23: error: ‘dummyx::dummyFunct’ cannot be used as a function
> $

I should have thought they would all compile, the last because of Koenig 
lookup.

Does it make any difference if you make dummyFunct a DummyFunct object rather 
than a reference to a DummyFunct object?

Chris





More information about the tuxCPProgramming mailing list