Title
__func__ should be constexpr
Status
open
Section
11.4.1 [dcl.fct.def.general]
Submitter
Anthony Polukhin

Created on 2017-10-23.00:00:00, last changed 2017-10-23.00:00:00.

Messages

Date: 2017-10-23.00:00:00

The definition of __func__ in 11.4.1 [dcl.fct.def.general] paragraph 8 is:

  static const char __func__[] = "function-name";

This prohibits its use in constant expressions, e.g.,

  int main () {
    // error: the value of __func__ is not usable in a constant expression
    constexpr char c = __func__[0];
  }
History
Date User Action Args
2017-10-23 00:00:00admincreate