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

    <tr>
        <th>Summary</th>
        <td>
            _Generic in C++ doesn't allow an elaborated type specifier as an association
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++,
            clang:frontend,
            rejects-valid
      </td>
    </tr>

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

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

<pre>
    Clang supports `_Generic` as an extension in C++ mode, but the following C++ code doesn't parse when it should:
```
struct S {
  int i;
};

void func(struct S s) {
  (void)_Generic(s, struct S : 1); //  error: 'S' cannot be defined in a type specifier \
                                       error: expected class name \
                                       error: expected '{' after base class list
                                           
}
```
This use is not defining a new type specifier, it's attempting to use an elaborated type specifier for referencing the type.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8tu2zAQ_BrqsohhU5ZsH3TwA-kHpPeCopYWC4oUyJWd_H2XchwHQVG0QAXa4mO1Mzs7bEP31hyd8mdI0ziGSAlEvfzxDT1Gq3kKKoHygK-EPtngwXo4CnngAUPoUMgjtBMB9QgmOBeulpPdIzRHQBcweSE3BKOKCeHaI6chSH2YXCfKvViexHLPYO9jXiaKkyZ4AbE53HaAsQmsKN_XYnN6zOf_S7AdmMlrIbcf3ychd5-T8FmO492PMjk61_GALPew4gBOz-HPPAAwxhDzAVfywj_QyvtA0HKBaKzHLkujgN5GhDSitsZiBFEd78B_9XzA4CvnIM6qnUoJvBrwPyRj4lkKpq8MMb1WcUNuCM4m-qfs-Xl04nc9_N7bBBMj8CtrNQuV_aHA4_WLVLkDlpgaG44Ih5FyJIU5QbagU22IKlfxRWMTIkQ0GNHr-Rv2Yg5ZFF1Tdrtypwqy5LC5N_yziR_uVNm9f0a6XQZWK2iriK9DMUXX9ERjyj6erXK21E_tQoeBF85d7q-nMYaf3AVe2pQmZMs9V1VVy6JnllVZbZWRujSlXu-UrHFXy267qdbrJZqCGaFLjaiYs9Q36jzLmuWNfIOZgInB8z3tHicRM2R6uihn5-3qVNhGLqVcVqvtqubZamF2606uja7X27ps661gyEFZt8i0FyGei9jMFbTTOfFhdkp6HLIc9uwRZ3acX03Uh9jsFbM5sKiD8sVccTOX-wsCqVKD">