<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Ambiguous instantiation while asserting requirement is not a hard error"
   href="https://bugs.llvm.org/show_bug.cgi?id=52524">52524</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Ambiguous instantiation while asserting requirement is not a hard error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>accepts-invalid
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++2b
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>johelegp@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, johelegp@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This came up at <a href="https://cpplang.slack.com/archives/C21PKDHSL/p1637078846410400">https://cpplang.slack.com/archives/C21PKDHSL/p1637078846410400</a>.

>From reading <a href="https://wg21.link/LWG3541">https://wg21.link/LWG3541</a>, it seems that the lack of a
disambiguating specialization should result in a hard error, which does not
happen. See <a href="https://godbolt.org/z/vMzPnYvr7">https://godbolt.org/z/vMzPnYvr7</a>.

```C++
#include <concepts>
template<class> struct trait { };
template<class T> concept has_type1 = requires { typename T::type1; };
template<class T> concept has_type2 = requires { typename T::type2; };
template<has_type1 T>                       struct trait<T> { using type =
typename T::type1; };
template<has_type2 T>                       struct trait<T> { using type =
typename T::type2; };
template<has_type1 T> requires has_type2<T> and std::same_as<typename T::type1,
typename T::type2>
                      struct trait<T> { using type = typename T::type1; };
template<class T> concept has_trait_type = requires { typename trait<T>::type;
};
struct Y {
  using type1 = double;
  using type2 = int;
};
static_assert(not has_trait_type<Y>);
```</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>