title: Why are char[] and char* as typedefs different, but sometimes... not?
body: <p>The following observation arose as I was following <a href="https://stackoverflow.com/questions/18625674/c-difference-between-const-char-and-const-char">this question</a> about <code>char[]</code> and <code>char*</code> differences.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  typedef char ar[];
  typedef char* pr;
  void f2(ar x, pr y)
  {
      std::cout &lt;&lt; std::is_same&lt;decltype(x), decltype(y)&gt;::value &lt;&lt; '\n';
      std::cout &lt;&lt; std::is_same&lt;ar, pr&gt;::value &lt;&lt; '\n';
  }
  
  int main()
  {
      char data[] = "data";
      char *ptr = data;
      f2(data,ptr);
      return 0;
  }
  </code></pre>
  
  <p><strong>Output</strong> ( on Apple LLVM version 4.2 (clang-425.0.28) )</p>
  
  <pre><code>1
  0
  </code></pre>
  
  <p>Why do these report as different types, but not different <code>decltype()</code>s ? My suspicion is they are in fact different <em>types</em> due to their <code>typedef</code> declarations, but then why are variables reported as the <em>same</em> type?</p>