title: `type_alias<char[N]>{}` VS `char[N]{}` in function's argument
body: <ul>
  <li>Environment: x86-64 <strong>Clang</strong> 6.0.0</li>
  </ul>
  
  <p>function's definition: </p>
  
  <pre><code>void foo(const char*) {}
  </code></pre>
  
  <ol>
  <li><code>foo(char[16]{}); //houston, there is a problem!</code></li>
  <li><code>foo(type_alias&lt;char[16]&gt;{}); //compile happily</code> </li>
  </ol>
  
  <p><code>type_alias</code> is simple:</p>
  
  <pre><code>template&lt;typename T&gt;
  using type_alias = T;
  </code></pre>
  
  <p><a href="https://godbolt.org/g/6MmABg" rel="nofollow noreferrer"><strong><code>live demon</code></strong></a></p>
  
  <hr>
  
  <p>As comment notes, <code>case 1</code> cannot compile while <code>case 2</code> can. </p>
  
  <p>I know that <code>alias declarations</code> with <code>using</code> is not text substitution(like <code>#define</code>) and it is a synonym for the type. </p>
  
  <p>But I still cannot figure out how to account for this situation. Then I give <strong>GCC</strong> a <a href="https://wandbox.org/permlink/RKLfaLiEU4HnW6HS" rel="nofollow noreferrer"><strong><code>try</code></strong></a>: </p>
  
  <pre><code>prog.cc: In function 'int main()':
  prog.cc:11:7: error: expected primary-expression before 'char'
     foo(char[16]{});
         ^~~~
  prog.cc:12:7: error: taking address of temporary array
     foo(type_alias&lt;char[16]&gt;{});
         ^~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>Ah, <strong>GCC</strong> gave me an error instead! Then I compile it with different versions of the two compilers: </p>
  
  <ul>
  <li><strong>Clang</strong>'s error message for <code>case 1</code> is: </li>
  </ul>
  
  <blockquote>
    <p>prog.cc:11:11: error: expected '(' for function-style cast or type construction</p>
  
  <pre><code>foo(char[16]{});
        ~~~~^
  </code></pre>
  </blockquote>
  
  <ul>
  <li><p><strong>Clang</strong> lets <code>case 2</code> pass. </p></li>
  <li><p><strong>GCC</strong>'s forbid both the two cases to pass competition. Error messages for <code>case 1</code> and <code>case 2</code> have been listed above. </p></li>
  </ul>
  
  <p>BTW, for <strong>Clang</strong>, I have also tested with <code>pedantic-errors</code>, but nothing changed. </p>
  
  <hr>
  
  <p>Questions: </p>
  
  <ul>
  <li>For <code>case 2</code>: <strong>Clang</strong>, <strong>GCC</strong>, who conforms the standard? Any spec in standard(language lawyer)?</li>
  <li>For <code>case 1</code>: Whose error message is more correct(IOW, conforms the standard)?</li>
  </ul>
  
  <h1>Update</h1>
  
  <p>As VTT comments, for <code>case 1</code>, it should be <code>foo(const char[16]{});</code>. Apology for this mistake. </p>
  
  <p>But <strong>Clang</strong> can compile <code>foo(type_alias&lt;char[16]&gt;{});</code>. It seems to be a bug? </p>