This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ testcase question: pointers to member functions
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Janis Johnson <janis187 at us dot ibm dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 8 Feb 2005 16:47:46 -0800
- Subject: Re: C++ testcase question: pointers to member functions
- References: <20050209001422.GA8273@us.ibm.com>
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.