title: implicit conversion during pass by value works, but pass by reference does not
body: <p>Compiling with clang++ 4.1:</p>
  
  <pre><code>class A
  {
  public:
      A(const char *s=0) : _s(s) {}
      const char *_s;
  };
  
  void f(A a)
  {
      cout &lt;&lt; a._s &lt;&lt; endl;
  }
  
  int main()
  {
      f("test");
      return 0;
  }
  </code></pre>
  
  <p>prints,</p>
  
  <pre><code>test
  </code></pre>
  
  <p>whereas if I define <code>f</code> as follows,</p>
  
  <pre><code>void fA(A &amp;a)
  {
      cout &lt;&lt; a._s &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I get a compilation error,</p>
  
  <pre><code>clang++ -std=c++11 -stdlib=libc++ -o test test.cpp
  test.cpp:14:5: error: no matching function for call to 'f'
      f("9000");
      ^
  test.cpp:7:6: note: candidate function not viable: no known conversion from
        'const char [5]' to 'A &amp;' for 1st argument;
  void f(A &amp;a)
       ^
  </code></pre>
  
  <p>Why?  I don't understand why making <code>f</code> take a reference leads to problems.</p>