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

    <tr>
        <th>Summary</th>
        <td>
            Clang 16-rc2 regression: inherited constructor with dependent constraint
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            c++20,
            clang:frontend,
            regression,
            rejects-valid,
            concepts
      </td>
    </tr>

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

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

<pre>
    Caught this testing MSVCSTL with 16-rc2. Our implementation of `std::ranges::subrange` has the dependent constraint. I suspect inheriting from `subrange` is fairly rare, and have a workaround, so this isn't a release blocker.

Compiling this well-formed TU:
```c++
template <class> struct B {
  static constexpr bool meow = false;
};

template <class T>
struct D : B<T> {
  template <int = 42>
  D(int) requires (!B<T>::meow) {}
};

struct S : D<void> { using D::D; };

int main() { S{42}; }
```
with `clang++ -std=c++20 -fsyntax-only` diagnoses (https://godbolt.org/z/8a7Maa63e):
```
repro.cpp:8:20: error: substitution into constraint expression resulted in a non-constant expression
  D(int) requires (!B<T>::meow) {}
 ^~~~~~~~~~~
repro.cpp:13:14: note: while checking constraint satisfaction for function 'D' required here
int main() { S{42}; }
 ^
repro.cpp:8:20: note: non-literal type '<dependent type>' cannot be used in a constant expression
  D(int) requires (!B<T>::meow) {}
 ^
1 error generated.
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vc2O6zYPfRpmQyRwpCSOF15k7BvgA76LLua2e9mmbXVkyZXomZsu-uyF7GSSdqYFCrRBYOuH4jk8pEwVgu4sUQ77J9iXKzVx73xeqECXQnkmv6pcc8kLNXU9I_c6IFNgbTv8-vxT8fzt__imucftYe1rscEfJo96GA0NZFmxdhZdi3BIAjcgTyBPXtmOwjIOUzVP4ZBgrwJyT9jQSLYhy1g7G9grbXmD_8MwhZFqRm178npm0Ho3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