For the following code typedef void f(int) const; gcc gives the following error message: foo.cc:1: error: invalid type qualifier for non-member function type foo.cc:1: error: 'const' and 'volatile' function specifiers on 'f' invalid in type declaration
That error message is incorrect. As 8.3.5/4 makes it clear, cv-qualifiers are valid in type declarations. 9.3/9 uses a typedef very much like this one in an example. -- Summary: gcc reject cv-qualifiers in function type typedef Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: austern at apple dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin7.7.0 GCC host triplet: powerpc-apple-darwin7.7.0 GCC target triplet: powerpc-apple-darwin7.7.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19245