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

    <tr>
        <th>Summary</th>
        <td>
            Substitution failure in requires-expression results in an error when a nested type doesn't exist
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            rejects-valid,
            concepts
      </td>
    </tr>

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

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

<pre>
    [GCC test `concepts-conv3` fails](https://godbolt.org/z/87z6zT79T). Looks like the comment explains why the code should be allowed.

```cpp
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s

// Here, normal overload resolution would consider B::operator bool when
// evaluating A(b), leading to a hard error instantiating Error<int>, but we
// avoid considering it by noticing that converting bool (a scalar) to A (a
// class) would require a user-defined conversion, which is not allowed when
// we're already dealing with the user-defined conversion to A.

// This seems to be allowed by [temp.inst]/9: "If the function selected by
// overload resolution (12.4) can be determined without instantiating a class
// template definition, it is unspecified whether that instantiation actually
// takes place."
// expected-no-diagnostics
template <class T>
struct Error { static constexpr auto value = T::value; };

struct A { A(const A&); };

template <class T>
struct B { operator bool() requires Error<T>::value; };

template <class T>
concept C = requires (B<T> b) { A(b); };

static_assert(!C<int>);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVU2P4zYM_TXKhUjgkRMnOeSQj01boOihnZ4XtEzH2lUkV6STyf76Qop3ZrLdbQsMZgaU-fj0-Eghsz15oo1a7NTiMMFBuhA35lNTT-rQ3FL8p_0ehFhAVYUJ3lAvPDXBX0pVFdCidawWB6VXnUjPqtwqfVT6eApNHZzMQjwpffyi9HG1_FJ9eV6un5Vez-DXED4zOPuZQDoCE85n8gL00ju0nuHa3caDhoC7MLgGagJ0LlypmanioIrt-Lsq7j-m78dIpgC___mbKreg9MI49KePxjzBlKVR5cEovVN6pwuYtnz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