This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/6628] cannot typedef const functions
- From: "ehrhardt at mathematik dot uni-ulm dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2003 18:27:52 -0000
- Subject: [Bug c++/6628] cannot typedef const functions
- References: <20020510135600.6628.ge@cs.twsu.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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