g++ 2.95.2 rejects linkage specification in typedefs

Martin Sebor sebor@roguewave.com
Tue Mar 28 15:25:00 GMT 2000


Hi,

the program below gives an error with g++ 2.95.2. I suppose this is just an
unimplemented feature (see 7.5, p4) so if that's so I suggest that it be
implemented without regard to the the current restriction that "A
linkage-specification shall occur only in namespace scope..." This is currently
a CWG issue and it is likely to be modified so that linkage-specifications can
occur in typedefs at function, class, function signature, and class template
scope. Please see CWG issue 13 and the recent discussion Re: linkage
specification on the CWG mailing list (c++std-core@research.att.com).


Regards
Martin

$ cat test.cpp

extern "C" typedef void foo ();

$ g++ -c --pedantic test.cpp
test.cpp:3: multiple storage classes in declaration of `foo'


More information about the Gcc-bugs mailing list