Bugzilla Bug 6628: cannot typedef const functions
Jeff Steidl
jsteidl@astronautics.com
Wed Aug 13 17:58:00 GMT 2003
The bug report looks like it was closed prematurely, or at least without
adequate explanation.
The following (including the explanatory comments) is copied directly out
of the ANSI C++ standard (ISO/IEC 14882, First Edition, Section 9.3, part 9):
---------------
typedef void fv(void);
typedef void fvc(void) const;
struct S {
fv memfunc1; // equivalent to: void memfunc1(void);
void memfunc2();
fvc memfunc3; // equivalent to: void memfunc3(void) const;
};
fv S::* pmfv1 = &S::memfunc1;
fv S::* pmfv2 = &S::memfunc2;
fvc S::* pmfv3 = &S::memfunc3;
---------------
Note that the 2nd line is identical to the code in the original bug report.
Also note that fvc is neither a member function, nor a nonmember function -
it is just a typedef.
The construct compiles and works correctly under Watcom 11.0b.
More information about the Gcc-bugs
mailing list