This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

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.



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