This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on recent method scoping changes
- To: dm at reeducation-labor dot lcs dot mit dot edu
- Subject: Re: Question on recent method scoping changes
- From: Klaus-Georg Adams <Klaus-Georg dot Adams at chemie dot uni-karlsruhe dot de>
- Date: Thu, 26 Nov 1998 10:29:03 +0100
- Cc: egcs at cygnus dot com
David wrote:
> struct foo {
> void m1 ();
> void m2 ();
> void (foo::*f) ();
> void set1 () { f = &m1; }
> };
>
> no longer compiles with egcs, even though it compiles with all old
> versions (and every other C++ compiler I've tried). The latest egcs
> [egcs-2.92.23 19981125 (gcc2 ss-980609 experimental)] gives:
>
> method-scope.C: In method `void foo::set1()':
> method-scope.C:5: object-dependent reference to `foo::m1()' can only be used in a call
> method-scope.C:5: to form a pointer to member function, say `&foo::m1'
>
> Is this change required by the final C++ standard?
Yes, please see http://www.cygnus.com/ml/egcs-bugs/1998-Oct/0741.html
for an explanation.
-- kga
-------------------------------------------------------------------------
Klaus-Georg Adams Email: Klaus-Georg.Adams@chemie.uni-karlsruhe.de
Institut f. Anorg. Chemie, Lehrstuhl II Tel: 49(0)721 608 3485
Universität Karlsruhe, D-76128 Karlsruhe
-------------------------------------------------------------------------