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]

Re: Question on recent method scoping changes



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
-------------------------------------------------------------------------


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