title: Why does parameterized constructor with vector of strings as argument does fail to compile?
body: <p>In below code default constructor as well as parameterized constructor with int argument are creating temporary objects. But vector of string as a parameter to constructor is not even compiling. Can anybody explain this behavior?</p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;string&gt;
  
  class C {                                                                                                                                                     
  public:                                                                                                                                                       
      std::vector&lt;std::string&gt; v;                                                                                                                               
      int i;                                                                                                                                                    
      C() {                                                                                                                                                     
  
      }                                                                                                                                                         
      C(int j) {                                                                                                                                                
          i = j;                                                                                                                                                
      }                                                                                                                                                         
  
      C(std::vector&lt;std::string&gt; tmp) {                                                                                                                         
          v = tmp;                                                                                                                                              
      }                                                                                                                                                         
  };
  
  int main() {                                                                                                                                                  
      std::vector&lt;std::string&gt; v = {"Stack", "Overflow"};                                                                                                       
      C();                        // works..                                                                                                                    
      C(1);                       // works..                                                                                                                    
      C(v);                       // compilation fails..                                                                                                        
      return 0;                                                                                                                                                 
  }
  </code></pre>
  
  <p>Below is the compilation output:</p>
  
  <pre><code>g++ -g constructor.cpp -std=c++1z
  constructor.cpp: In function ‘int main()’:
  constructor.cpp:25:8: error: conflicting declaration ‘C v’
       C(v);      // compilation fails..
          ^
  constructor.cpp:22:27: note: previous declaration as ‘std::vector&lt;std::__cxx11::basic_string&lt;char&gt; &gt; v’
    std::vector&lt;std::string&gt; v = {"Stack", "Overflow"};
                             ^
  </code></pre>