[cfe-dev] Problems with modern versions of libstdc++
Christopher Jefferson
chris at bubblescope.net
Wed Feb 17 08:31:08 PST 2010
On 17 Feb 2010, at 15:59, Douglas Gregor wrote:
>
>
>> More worryingly, once I upgrade to a current svn version of g++ 4.5, <ios> (and therefore most files involving streams, including ostream/istream/fstream) fails to compile due to the following code in locale_facets.h
>>
>> template<typename _Tv>
>> void
>> __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
>> const __c_locale& __cloc);
>>
>>
>> template<>
>> void
>> __convert_to_v(const char*, float&, ios_base::iostate&,
>> const __c_locale&) throw();
>>
>> Which fails to compile with the error:
>>
>> /gccsvn/lib/gcc/x86_64-apple-darwin10.2.0/4.5.0/../../../../include/c++/4.5.0/bits/locale_facets.h:71:5: error:
>> exception specification in declaration does not match previous declaration
>> __convert_to_v(const char*, float&, ios_base::iostate&,
>> ^
>> /gccsvn/lib/gcc/x86_64-apple-darwin10.2.0/4.5.0/../../../../include/c++/4.5.0/bits/locale_facets.h:65:5: note:
>> previous declaration is here
>> __convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
>> ^
>>
>>
>> Should such bugs be reported up-stream?
>
> Yes, this code is ill-formed and should reported to them.
Just to confirm so it does not get lost, I will deal with this problem. After this is fixed, it seems like clang is at least parsing all the g++4.5 headers, ignoring the TR1/C++0x ones obviously.
>
>> Would clang add support for such g++-specific code, if it was not fixed upstream?
>
>
> If they don't fix it by the time GCC 4.5 is released, we'll probably be forced to put in some kind of compatibility hack, e.g., downgrading this error to a warning. Compatibility with libstdc++ is extremely important: look for __is_pod in the Clang parser to see what horrible things we've already done toward this goal :)
>
> - Doug
More information about the cfe-dev
mailing list