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]

[Bug c++/6628] cannot typedef const functions


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6628


ehrhardt at mathematik dot uni-ulm dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2003-08-13 18:27:52
               date|                            |


------- Additional Comments From ehrhardt at mathematik dot uni-ulm dot de  2003-08-13 18:27 -------
Reopened based on http://gcc.gnu.org/ml/gcc-bugs/2003-08/msg01573.html:

The following piece of code taken directly from the standard (9.3)
shows that the typedef should be legal.
============= cut =====================
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;
============= cut =====================

However, current mainline gives the following error:
thales$ ~/gcc-3.4-cvs/install/bin/g++ 6628.cc 
6628.cc:2: error: invalid type qualifier for non-member function type
6628.cc:2: error: `const' and `volatile' function specifiers on `fvc' invalid 
   in type declaration

   regards  Christian


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