title: Candidate constructor (the implicit copy constructor) not viable: expects an l-value for 1st argument
body: <h1>The problem</h1>
  <p>I have a <code>Deck</code> class which is a container for 52 <code>Card</code> objects. <code>Deck</code> is derived from another class called <code>CardCollection</code> (since I want similar groups of Cards elsewhere that are not a full deck of cards). My Problem is that I can create a <code>Deck</code> object using</p>
  <pre><code>Deck deck();
  </code></pre>
  <p>But when I use</p>
  <pre><code>Deck deck = Deck();
  </code></pre>
  <p>Clang-tidy (in CLion) complains that <code>Candidate constructor (the implicit copy constructor) not viable: expects an l-value for 1st argument</code>. My understanding (based on <a href="https://stackoverflow.com/questions/49802012/different-ways-of-initializing-an-object-in-c/49802943">this</a> question was that these two ways of instantiating were basically the same, but since one causes warnings</p>
  <h1>The Code</h1>
  <p>I'll only paste the constructors of these class declarations to prevent this beign a &quot;wall-o-text&quot; question.</p>
  <pre><code>//Card.h
  
      class Card {
      public:
          int rank; 
          basic_string&lt;char&gt; suit;
  
          Card(int r, std::string s); // rank and suit
  
          ~Card();
  
      //...
  }
  
  </code></pre>
  <pre><code>// CardCollection.h
  #include &lt;vector&gt;
  #include &quot;Card.h&quot;
  
  
  class CardCollection {
  
  protected:
      vector&lt;Game::Card&gt; _cards;
  public:
      CardCollection();
       ~CardCollection();
       CardCollection(CardCollection &amp;other);
       explicit CardCollection(int n);
       explicit CardCollection(vector&lt;Game::Card&gt; &amp;cards);
      //...
  </code></pre>
  <p>and</p>
  <pre><code>// Deck.h
  
  #include &quot;Card.h&quot;
  #include &lt;vector&gt;
  #include &quot;CardCollection.h&quot;
  
  class Deck : public CardCollection {
  public:
      Deck();
      ~Deck();
      explicit Deck(vector&lt;Game::Card&gt; &amp;cards);
      Deck * shuffle();
      //...
  };
  
  
  </code></pre>