[cfe-dev] Tool oddity

Azat Khuzhin a3at.mail at gmail.com
Wed Apr 1 01:21:53 PDT 2015


On Sun, Mar 29, 2015 at 05:57:23AM +0100, Peter Stirling wrote:
> This is at the outer limits of my understanding of templates, but if I
> comment out the following
> 
>   inline string
>   to_string(float __val)
> {
>     const int __n =
>       __gnu_cxx::__numeric_traits<float>::__max_exponent10 + 20;
>     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
>         "%f", __val);
> }
> 
>   inline string
>   to_string(double __val)
> {
>     const int __n =
>       __gnu_cxx::__numeric_traits<double>::__max_exponent10 + 20;
>     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
>         "%f", __val);
> }
> 
>   inline string
>   to_string(long double __val)
> {
>     const int __n =
>       __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
>     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
>         "%Lf", __val);
>   }
> 
> Then the errors go away.

I also have this issue with to_string(float/double/long double), and for
me assert() in ActOnFinishFunctionBody() failed, but this was because I
ignore errors (After
DiagnosticsEngine::{Reset(),setIgnoreAllWarnings()}, using ASTConsumer):

And I wrote a patch and a regression:
http://reviews.llvm.org/D8458 # patch for ParseExpr.cpp
http://reviews.llvm.org/D8457 # regression test



More information about the cfe-dev mailing list