<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/134613>134613</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang 20 implicit CTAD regression?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ngladitz
      </td>
    </tr>
</table>

<pre>
    ```C++
#include <type_traits>

template<typename R>
struct Foo
{
        using value_type = R ;

        Foo() = default;
    Foo(const Foo&) = delete;
    Foo(Foo&&) = delete;

        Foo(Foo<Foo<R>>&& rhs)
        {
        }
};

/*template<typename R>
Foo(Foo<Foo<R>>&&) -> Foo<R>;*/

int main()
{
        auto r1 = Foo(Foo<Foo<int>>{});
        static_assert(std::is_same_v<decltype(r1)::value_type, int>);
}
```

Compiles with Clang 19.1.0 but fails the static_assert with Clang 20.1.0: https://godbolt.org/z/daqjan7e5
Uncommenting the explicit deduction guide seems to work around the issue.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEU81u4zYQfprRZRCDImVbOujgyNEDLNqzQZETmVuKdMVRtrtPX1ByNk5bdAGBPsw3359JnZIbA1EL-2fYnwu98DXObRi9to5_FEO031s4iO3rQD7nT5xAKheMXywhqI6_3-jCs3acQL3ksTgxTTevme7joCfCL9s08bwYxj7GDD2ufKJZkgsjvmm_0CVvIKgzfkFQ2zxD8oasQTbrzNKrXjxvAETEbWxiSBu5PHxAPWUrn5HvmP-EPSrmU3XbuWZQL9siztcEstmwP5PA8bwGO38wyR7k_1XyC51s8AnUCz7OnkGuxKuCC4yTdmHr57FXvXDEuVwD_lvGBb4LHZ-zY9m8m24Sa3bmolOimUHWiS2oE6iTS5ekJ7q8geosGZ_DgKznct3OiI9_EWSHd42f1Fs975dq89_F6eY8Jfzm-Iqd12HEstmVO4HDwviqnU_IV8JPrh7RUmQ0qBNemW8pG8mt92O0Q_S8i_MIsv8Bsrf6z686HGkP4vR7MHGaKHC-fJmf_rp5ZxyjJbsYdjHguDhLmIimhBzxW5z_QD3HJdh1w6W00K6wrbKNanRBbXmsKiGr_bEprq0VSpaVql_LPYnmWJtGy6aspBjIGlMPhWulkHtRiWNZloey2dGgjdnXB6NqUrbSUAmatPM779-mnKNYJdtSVYdSFV4P5NP6gqU0uQuQMj_muc0LT8MyJqiEd4nTBwU79tS-V4duusfufjudcaZxppRcDKD6Ypl9-49OHV-XYWfiBLLPlPefp9scv5JhkP1qMYHs7y7fWvl3AAAA___OU04U">