This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ testcase question: pointers to member functions


On Tue, Feb 08, 2005 at 04:14:22PM -0800, Janis Johnson wrote:
> Can someone who understands C++ pointers to member functions please
> take a look at this?
> 
> g++.old-deja/g++.mike/p10769a.C is a "run" test that fails to compile
> due to errors that the test claims are bogus.  PR 10769 was for an ICE.
> The test was introduced 1997-08-19, comments that the errors are bogus
> were added 1998-10-19, and the PR was closed 2003-05-14.

The test itself is extremely bogus.  A pointer to member function and a
pointer to function are very different beasts, and for another thing
a pointer to member function won't, in general, fit in one word.  It's
kind of astounding that it ever worked; I assume at one point the casting
to a pointer and back sliced off the field that indicates whether the PMF
is for a virtual or nonvirtual function and somehow reconstructed it
correctly.  So if this test ever worked it worked by accident.

> If the errors are indeed bogus then this needs a new PR to track the
> problem.  C++ has changed a lot, though, so if the errors are now
> expected then this ought to be changed to a "compile" test, with
> dg-bogus replaced by dg-error and the expected text.  Fixing the test
> will get rid of the following annoying message in all test summaries:
> 
>   WARNING: g++.old-deja/g++.mike/p10769a.C compilation failed to produce
>   executable

It should be a compile test, and it should fail to compile.  Or maybe it
should just be killed.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]