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

    <tr>
        <th>Summary</th>
        <td>
            Clang produces unhelpful diagnostics for a concept declared in a function head
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:diagnostics
      </td>
    </tr>

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

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

<pre>
    Given `void f(concept int);`, Clang will emit the following:
```
error: variable has incomplete type 'void'
void f(concept int);
 ^
error: expected expression
void f(concept int);
 ^
```
Neither of these diagnostics describe the two problems with the source. Better diagnostics would look like:
```
error: concepts can only be declared a global entity, but it's declared as a function parameter here
void f(concept int);
       ^
error: expected unqualified-id
void f(concept int);
               ^
```
I'd personally prefer for the second one to be `expected an unqualified identifier, got keyword 'int'`, but that's beyond the scope of this commit due to how much it impacts.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlM1y4zYMx5-GumDiUSjLsg86JLt1p5e-A0RCEjYUofIjrt--Qznten3YbjSa0RcB_PHjH8IYefJEvWpfVfu1wpxmCb35ZodqEHvtf-d38qAO9buwhVHpoxFvaE3APil9Us2rOtRKf4EvDv0EF3YOaOEEaSYYxTm5sJ9U86Lqr6p-KYtv5_ZIIUhQzQu8Y2AcHMGMEdgbWVZHiSBdVwKlu1Je6e4W9RMt23dQ7W8P-envlUwiW24CxcjiP5vrQfqfxGmmADKWViOBZZy8xMQmgqVoAg-0UUgXgTXI4GiJcOE0b2-j5GBoB6-UEoUfoi-SnQUn8gaO3-h_4X1Ij2DQg3h3hYHAknEYyALC5GRAB-QTp2vZqyEn4KR0F--WRUAYszeJxcOKARcqwmYK9IuobsdP4Gf_V0bHI5N9YvuprPCY_QHGH0p3FlYKUTw6d4U10EgBRgk33GTEWxBPkKTwUYf6P13o76UB24JqZAoF1iQJ3uh6kWCLEzd53YfpC8g04w3lQNdSYqtmZKWbNTiCkaVMhM1b7VkusGQzAyfgZUWT4q6yfWNPzQkr6p8P3enU6qbeV3OP1qIdatOZhjraH1vU9rgnbI-IaI664l7Xuqkb3eln3db7XWv0OBjdnJA6anFU-5oWZLdz7n3ZSZgqjjFTf3ju9nXlcCAXt_HX2pQRVs3LnReV1uW_EPoS_TTkKap97Tim-D1f4uSov83_GsRmQxGyn8mtY3Y_OLvsBv7r1-_eY3_vvZnQVjm4fk5pjcX9-qz0eeI052FnZFH6XIp_XJ7WIN_IJKXPW2dR6fPW3D8BAAD__zfcj-o">