<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - constexpr __FUNCTION__, __func__, and __PRETTY_FUNCTION__"
   href="https://llvm.org/bugs/show_bug.cgi?id=26927">26927</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>constexpr __FUNCTION__, __func__, and __PRETTY_FUNCTION__
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>djeedai@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Being able to use __FILE__ and __LINE__ to initialize constexpr variables is
already supported, and a valuable feature. However the non-standard
__FUNCTION__, __func__, and __PRETTY_FUNCTION__ don't seem to be declared in
such a way that would allow them to do so:

void func()
{
  constexpr static const char this_file[] { __FILE__ }; // OK
  constexpr static const int this_line = __LINE__; // OK
  constexpr static const char this_func[] { __PRETTY_FUNCTION__ }; // compiler
error: not a constant expression
}

MSVC allows this with __FUNCSIG__. It seems there's no plan to add this for GCC
though: <a href="https://gcc.gnu.org/ml/gcc-bugs/2015-06/msg02292.html">https://gcc.gnu.org/ml/gcc-bugs/2015-06/msg02292.html</a>

This is somewhat related to #20013, although #20013 is just one possible way to
fix this.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>