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

    <tr>
        <th>Summary</th>
        <td>
            C2X conditional operator and qualifiers on pointer to arrays
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    With N2607 arrays are considered to have the same qualifier as the element. Clang mostly
already behaves according to these rules but there seems to be one remaining inconsistency
in the conditional operator.  The standard says:

— both operands are pointers to qualified or unqualified versions of compatible types;

Clang incorrectly warns about a pointer type mismatch in the following example that
should be ok when considering arrays to be qualified according to N2607.

int a[3] = { 0 };
const int b[3] = { 0 };

const void* foo(void)
{
    return (0 ? &a : &b);
}

https://godbolt.org/z/E18rdqa5j
(BTW: This would also remove an inconsistency with respect to C++) 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U01zozAM_TVw0WyGQEjgwCHpx3FPneleZawEt8amtkk2--tXJqRJOzvL8GFhSe_pSRZWnptXFTr4ma-zDaBzePb8IWit8UqSIwnBQodHgtAReOwJPkbUaq_IAfrpL2nqyYQFPGg0B-itD_qcZI9JtkXtCOUZBMUcnLttrZOKvTgtx3oCN2reEGOINkN7ot7HbUFgDe9Tj8rEEGUmWj6Qaef8ykwM-L9UQVmDGuxADoN1C4CXSDmgkegkcz_7pNhe4ub3U55UWVKvQFhWYYo08qLAYJUJ5CYm14olWAejuZlHdmBUD3bPHPoBgxKapToPxFi7e6yLNrEE56hlgeCEjiNRWC4dr3hTLPTK9xjaDub69lZre4oa0G_shwjRYbgk9p0dtZzUeodTR-azedF_7ulFzhvxL32Yur-4J8tUAJNyVyTlIyQFP5sdZPx-_KwqggSIjuL_jvfuR6tkkm-5Hpvk1cWqZ7fN7A98OQqjM8A-nKt45sUaebGNCxFDPpMz0B1KF8IwNTl_5vtgpbA6LKw7sPWHn6dl5eQHlm9zUF7tXl5j3pdOeThNQqL2Ng6d5ZlH83Xo4BRPiyM_cAujdA9JvpvuGlLZFLIuakyDCpqah_zXP-eSk8rbGeLRMbfe27lf6eh0860YRh7FgqeMDa2P18-Pwdk3ZsOm8n7kucufy1W5rtKuqdq2KMW-lDVV5VIucZ3jqs72GxT1UpJINQrSvuEGcv9S1eRZnmdFvl4WS65ksa-y9WZFq2LT7pebipJVFg-jXkTgKGvqmomDGA-eNzXL5G-b6L06GKJrfhxDZ10zUvtOLp3YNhPVvymzeQQ">