title: C++20 concepts support in CLang
body: <p>I'm trying to compile an example of some concept from <a href="https://en.cppreference.com/w/cpp/concepts/regular" rel="nofollow noreferrer">cppreference</a> with Clang on Mac and it fails. How can I fix the issue and compile the example?</p>
  <p>Code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;concepts&gt;
  #include &lt;iostream&gt;
   
  template&lt;std::regular T&gt;
  struct Single {
      T value;
      friend bool operator==(const Single&amp;, const Single&amp;) = default;
  };
   
  int main()
  {
      Single&lt;int&gt; myInt1{4};
      Single&lt;int&gt; myInt2;
      myInt2 = myInt1;
   
      if (myInt1 == myInt2)
          std::cout &lt;&lt; &quot;Equal\n&quot;;
   
      std::cout &lt;&lt; myInt1.value &lt;&lt; ' ' &lt;&lt; myInt2.value &lt;&lt; '\n';
  }
  </code></pre>
  <p>Terminal output:</p>
  <pre class="lang-sh prettyprint-override"><code>% g++ -std=c++20 -o a a.cpp
  a.cpp:4:15: error: no type named 'regular' in namespace 'std'
  template&lt;std::regular T&gt;
           ~~~~~^
  a.cpp:6:5: error: unknown type name 'T'
      T value;
      ^
  a.cpp:12:12: error: template argument for non-type template parameter must be an expression
      Single&lt;int&gt; myInt1{4};
             ^~~
  a.cpp:4:23: note: template parameter is declared here
  template&lt;std::regular T&gt;
                        ^
  a.cpp:13:12: error: template argument for non-type template parameter must be an expression
      Single&lt;int&gt; myInt2;
             ^~~
  a.cpp:4:23: note: template parameter is declared here
  template&lt;std::regular T&gt;
                        ^
  4 errors generated.
  </code></pre>
  <p>Compiler version:</p>
  <pre class="lang-sh prettyprint-override"><code>% g++ --version
  Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
  Apple clang version 12.0.5 (clang-1205.0.22.11)
  Target: x86_64-apple-darwin20.5.0
  Thread model: posix
  InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  </code></pre>
  <p>What's interesting is that the example successfully compiles on <a href="https://godbolt.org/z/KMY3nvc74" rel="nofollow noreferrer">GodBolt</a> with lower CLang version (12.0.1)</p>