On 2016.03.25 at 17:29 -0400, Jason Merrill wrote: > 70353 is a problem with the function-local static declaration of __func__. > Normally constexpr functions can't have local statics, so this is only an > issue with __func__. Meanwhile, core issue 1962 looks like it's going to be > resolved by changing __func__ et al to be prvalue constants of type const > char * rather than static local array variables, so implementing that > proposed resolution also resolves this issue, as well as 62466 which > complains about the strings not being merged between translation units. > This patch proceeds from Martin's work last year. > > Tested x86_64-pc-linux-gnu, applying to trunk.
It breaks building Firefox: trippels@gcc2-power8 places % cat nsNavHistory.ii struct A { template <int N> A(const char (&)[N]); }; void fn1() { A(__func__); } trippels@gcc2-power8 places % c++ -c nsNavHistory.ii nsNavHistory.ii: In function ‘void fn1()’: nsNavHistory.ii:4:24: error: no matching function for call to ‘A::A(const char*&)’ void fn1() { A(__func__); } ^ nsNavHistory.ii:2:20: note: candidate: template<int N> A::A(const char (&)[N]) template <int N> A(const char (&)[N]); ^ nsNavHistory.ii:2:20: note: template argument deduction/substitution failed: nsNavHistory.ii:4:24: note: mismatched types ‘const char [N]’ and ‘const char*’ void fn1() { A(__func__); } ^ nsNavHistory.ii:1:8: note: candidate: constexpr A::A(const A&) struct A { ^ nsNavHistory.ii:1:8: note: no known conversion for argument 1 from ‘const char*’ to ‘const A&’ nsNavHistory.ii:1:8: note: candidate: constexpr A::A(A&&) nsNavHistory.ii:1:8: note: no known conversion for argument 1 from ‘const char*’ to ‘A&&’ So I'm not sure if your patch is really appropriate at this time. Maybe waiting until next stage 1 would be better? -- Markus