title: Is gcc wrongly evaluating std::declval in this concept definition?
body: <p>In this concept definition:</p>
  <pre><code>#include &lt;utility&gt;
  
  template&lt;class Func, class Ret, class... Args&gt;
  concept Invokable = requires(Func f) {
      { f(std::declval&lt;Args&gt;()...) } -&gt; Ret;
  };
  </code></pre>
  <p>when instantiated like this:</p>
  <pre><code>static_assert(Invokable&lt;decltype([](int){}), void, int&gt;);
  </code></pre>
  <p>gcc-9.0.1 (trunk) dumps (well, the Standard Library implementation to be precise):</p>
  <blockquote>
  <pre><code>$ g++ -O2 -std=c++2a -fconcepts -Wall -Wextra -Werror -c tu1.cpp
  error: static assertion failed: declval() must not be used!
  2204 |       static_assert(__declval_protector&lt;_Tp&gt;::__stop,
       |                                               ^~~~~~
  </code></pre>
  </blockquote>
  <p>demo: <a href="https://godbolt.org/z/D0ygU4" rel="noreferrer">https://godbolt.org/z/D0ygU4</a></p>
  <p><strong>Is it wrong to reject this code?</strong> If not, what did I do wrong? If yes, where should one report this bug?</p>
  <hr />
  <h2>Notes</h2>
  <h3>This is accepted</h3>
  <pre><code>template&lt;auto f, class... Args&gt;
  constexpr auto size_of_return_type = sizeof(f(std::declval&lt;Args&gt;()...));
  </code></pre>
  <p>when instantiated like so:</p>
  <pre><code>static_assert(sizeof(int) == size_of_return_type&lt;[](int){ return 0; }, int&gt;);
  </code></pre>
  <p>Demo: <a href="https://godbolt.org/z/gYGk8U" rel="noreferrer">https://godbolt.org/z/gYGk8U</a></p>
  <h3>Latest C++2a draft states:</h3>
  <blockquote>
  <p><a href="http://eel.is/c++draft/expr.prim.req#2" rel="noreferrer"><code>[expr.prim.req]/2</code></a>
  A requires-expression is a prvalue of type bool whose value is described below. Expressions appearing within a requirement-body are unevaluated operands.</p>
  </blockquote>