clang error : note: candidate constructor (the implicit move constructor) not viable:
<p>I have a following use case which is causing clang to emit errors.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;type_traits&gt;

class A
{
    public:
        int x;
        A(int g):x(g){}
};

class B : public A
{
    public:
        int y;
        B(int p):A(p),y(p) {}
};

class Holder
{
    template&lt;typename T&gt;
        Holder(typename std::enable_if&lt;!std::is_same&lt;T,A&gt;::value
                     &amp;&amp; std::is_base_of&lt; A , T&gt;::value &gt;::type&amp;&amp; val)
        : b (std::forward&lt;T&gt;(val))
        {}


    private:
        B b;
};

int main()
{
    B b(10);

    Holder h(b);
}
</code></pre>

<p>The error is as follows</p>

<pre><code>forward.cpp:35:12: error: no matching constructor for initialization of 'Holder'
    Holder h(b);
           ^ ~
forward.cpp:18:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'B' to 'const Holder' for 1st argument
class Holder
      ^
forward.cpp:18:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'B' to 'Holder' for 1st argument
class Holder
      ^
forward.cpp:21:9: note: candidate template ignored: couldn't infer template argument 'T'
        Holder(typename std::enable_if&lt;!std::is_same&lt;T,A&gt;::value
        ^
1 error generated.
</code></pre>

<p>when compiled with <code>clang++ --std=c++11 forward.cpp</code>.</p>

<p>What am I missing here? </p>

<p>I have already consulted <a href="https://stackoverflow.com/questions/20008689/why-is-a-conversion-operator-not-called-when-using-initialization-syntax-and-wh">this</a> and <a href="https://stackoverflow.com/questions/7457370/c-constructor-calling-and-object-creation">this</a> questions, however they didnt seem to solve my use case.</p>