title: Why __func__, __FUNCTION__ and __PRETTY_FUNCTION__ aren't preprocessor macros?
body: <p>I've just noticed that <code>__func__</code>, <code>__FUNCTION__</code> and <code>__PRETTY_FUNCTION__</code> aren't treated as preprocessor macros and they're not mentioned on the <em>16.8 Predefined macro names</em> section of the Standard (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4527.pdf">N4527 Working Draft</a>).</p>
  
  <p>This means that they cannot be used in the string concatenation trick of <a href="http://en.cppreference.com/w/cpp/language/translation_phases">phase 6</a>:</p>
  
  <pre><code>// Valid
  constexpr char timestamp[]{__FILE__ " has been compiled: " __DATE__ " " __TIME__};
  // Not valid!!!
  template &lt;typename T&gt;
  void die() { throw std::runtime_error{"Error detected in " __PRETTY_FUNCTION__}; }
  </code></pre>
  
  <p>As far as I know, the <code>__FILE__</code>, <code>__DATE__</code> and <code>__TIME__</code> are translated to string literals as stated by the standard:</p>
  
  <blockquote>
    <h3>16.8 Predefined macro names [cpp.predefined]</h3>
    
    <p><code>__DATE__</code></p>
    
    <p>The date of translation of the source file: a <strong>character string literal of the form <code>"Mmm dd yyyy"</code></strong>, where the names of the months are the same as those generated by the asctime function, and the first character of dd is a space character if the value is less than 10. If the date of translation is not
    available, an implementation-defined valid date shall be supplied.</p>
    
    <p><code>__FILE__</code></p>
    
    <p>The presumed name of the current source file (a <strong>character string literal</strong>).</p>
    
    <p><code>__TIME__</code></p>
    
    <p>The time of translation of the source file: a <strong>character string literal of the form <code>"hh:mm:ss"</code></strong> as in the time generated by the asctime function.</p>
  </blockquote>
  
  <p><code>__func__</code> is mentioned by the standard as a function-local predefined variable of the form:</p>
  
  <pre><code>static const char __func__[] = "function-name ";
  </code></pre>
  
  <p>So the fact is that is a local variable hence the string concatenation trick doesn't works with it.</p>
  
  <p>As for <code>__FUNCTION__</code> and <code>__PRETTY_FUNCTION__</code> aren't mentioned in the standard (are implementation defined?) but is a pretty safe bet to think that they would behave like <code>__func__</code>.</p>
  
  <p>So the question is: Why <code>__func__</code>, <code>__FUNCTION__</code> and <code>__PRETTY_FUNCTION__</code> are function-local static constant array of characters while <code>__FILE__</code>, <code>__DATE__</code> and <code>__TIME__</code> are string literals? What's the rationale (if any) behind this decision?</p>