This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/561
- To: nobody at gcc dot gnu dot org
- Subject: Re: c++/561
- From: nathan at gcc dot gnu dot org
- Date: 25 Sep 2000 12:46:00 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: nathan at gcc dot gnu dot org
The following reply was made to PR c++/561; it has been noted by GNATS.
From: nathan@gcc.gnu.org
To: sebor@roguewave.com, dmies@bluekite.com, gcc-gnats@gcc.gnu.org,
gudjon.gunnarsson@mscsoftware.com, nobody@gcc.gnu.org
Cc:
Subject: Re: c++/561
Date: 25 Sep 2000 12:36:12 -0000
Synopsis: Compiler Error Casting Overloaded Function Pointers
State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Mon Sep 25 05:36:12 2000
State-Changed-Why:
The code is ill-formed.
[13.4]/1 enumerates when overload resolution is applied to
address of member function. The last option applies here
(an explicit type conversion). The paragraph states 'the
function selected is the one whose type matches the target
type required in the context' In this case `void (A::*)()'.
Neither choice matches that type, so the diagnostic is
required.
You are attempting to perform both overload resolution and
the downcast of a pointer-to-member in a single cast --
that's too much for C++. Please let me know if the desired
behaviour is explicitly documented as an extension in those
compilers that accept it.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=561&database=gcc