#1615 __func__ breaks constexpr (C++11)

OTHER
open
Cesar Strauss
gcc (462)
Bug
none
Unknown
False
2013-02-08
2012-01-09
thomas
No

// good
//static const char func[] = "function-name";
//constexpr const char* x() { return func; }

// bad
constexpr const char* x() { return __func__;}

int main()
{
__builtin_puts(x());
return 0;
}

-----> error: body of constexpr function 'constexpr const char* x()' not a return-statement

Discussion

  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    Assigning to Cesar for follow up.

     
  • Earnie Boyd
    Earnie Boyd
    2012-06-14

    • assigned_to: nobody --> cstrauss
     
  • Earnie Boyd
    Earnie Boyd
    2013-02-08

    • milestone: --> OTHER
    • type: --> Bug
    • resolution: --> none
    • category: --> Unknown
    • patch_attached: --> False