title: A variable template that is true iff a class template would instantiate?
body: <p>Let's say I have a class template A that has one type template parameter, and a single primary specialization:</p>
  <pre><code> template&lt;typename T&gt; struct A {
      /*...*/
   };
  </code></pre>
  <p>For some <code>T</code> arguments <code>A&lt;T&gt;</code> will instantiate successfully, for others it won't.</p>
  <p>Without modifying or extending the definition of <code>A</code>, is it possible to write a bool variable template:</p>
  <pre><code>template&lt;typename T&gt;
  constexpr bool WorksWithA = /*...*/;
  </code></pre>
  <p>such that <code>WorkWithA&lt;T&gt;</code> is true iff <code>A&lt;T&gt;</code> would instantiate successfully?</p>
  <p><strong>Update</strong></p>
  <p>Posted this as separate question: <a href="https://stackoverflow.com/q/66209966/1131467">Using typename in C++20 requires / concept?</a></p>
  <pre><code>#include &lt;iostream&gt;
  
  template&lt;typename T&gt;
  struct A {
      using X = typename T::X;
  };
  
  template&lt;typename T&gt;
  constexpr bool WorksWithA = requires { typename A&lt;T&gt;; };
  
  struct GoodArg {
      using X = int;
  };
  
  struct BadArg {
  };
  
  int main() {
      std::cout &lt;&lt; WorksWithA&lt;GoodArg&gt; &lt;&lt; std::endl;
      std::cout &lt;&lt; WorksWithA&lt;BadArg&gt; &lt;&lt; std::endl;
  }
  </code></pre>
  <p>Compiled and run with:</p>
  <pre><code>$ clang++ --version
  clang version 10.0.0-4ubuntu1 
  $ clang++ test.cc -std=c++20
  $ ./a.out 
  1
  1
  </code></pre>
  <p>This outputs <code>1 1</code>, expected output is <code>1 0</code> ?</p>
  <p>What gives?</p>