This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bugzilla Bug 6628: cannot typedef const functions
- From: Jeff Steidl <jsteidl at astronautics dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: ge at cs dot twsu dot edu,lerdsuwa at gcc dot gnu dot org,phil at jaj dot com
- Date: Wed, 13 Aug 2003 12:58:31 -0500
- Subject: Bugzilla Bug 6628: cannot typedef const functions
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.