const qualifier for function type

Nathan Ridge zeratul976@hotmail.com
Sat Apr 2 03:57:00 GMT 2011


GCC compiles the following code without error:

template<typename>
struct S;

template <>
struct S<void()>;

template <>
struct S<void() const>;


However, both Comeau C++ and clang give the following error:

error: type qualifier is not allowed on this function
struct S<void() const>;


Is the code ill-formed and gcc thus non-conforming?

I ask because libstdc++ uses specializations like this for std::is_function in <type_traits>, 
and as a result, clang refuses to compile anything that includes <type_traits>.

Thanks,
Nate.
 		 	   		  



More information about the Gcc-help mailing list