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

    <tr>
        <th>Summary</th>
        <td>
            Clang rejects a valid generic lamba within a conditional explicit for a constructor template of a class template
        </td>
    </tr>

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

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

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

<pre>
    In the following example, all 5 variable declarations should succeed, but the three instantiations of a class template fail, leaving only the non-template classes to succeed.  This interpretation has been validated against current gcc compilers.

Code example also available at Godbolt: https://godbolt.org/z/d488W9xGn

```
#include <type_traits>
#include <utility>

struct Best {
   template <class ...U>
   explicit( []<std::size_t ...I>(std::index_sequence<I...>) consteval
               { return sizeof...(U) > 1; }
               ( std::index_sequence<1uz>{} )
 )
   Yest(U const &...)
   {}
};

struct Jest {
   template <class ...U>
   explicit( []<std::size_t I>(std::index_sequence<I>) consteval
               { return sizeof...(U) > 1; }
               ( std::index_sequence<1uz>{} )
           )
   Zest(U const &...)
 {}
};

template <typename ...T>
struct Test {
   template <class ...U>
 explicit( []<std::size_t ...I>(std::index_sequence<I...>) consteval
 { return sizeof...(U) > 1; }
               ( std::index_sequence_for<T...>{} )
           )
   Test(U const &...)
 {}
};


template <typename T>
struct Yest {
   template <class ...U>
 explicit( []<std::size_t ...I>(std::index_sequence<I...>) consteval
 { return sizeof...(U) > 1; }
               ( std::index_sequence<1uz>{} )
           )
   Yest(U const &...)
 {}
};

template <typename T>
struct Zest {
   template <class ...U>
 explicit( []<std::size_t I>(std::index_sequence<I>) consteval
 { return sizeof...(U) > 1; }
               ( std::index_sequence<1uz>{} )
 )
   Zest(U const &...)
   {}
};

int main() {

   Best y = 3.14;
   Jest         z = 3.14;
   Test<double> x = 3.14;
 Yest<double> y = 3.14;
   Zest<double> z = 3.14;
}
```
</pre>
<img width="1"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