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

    <tr>
        <th>Summary</th>
        <td>
            Clang fails to error on unknown command line options that start with -u
        </td>
    </tr>

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

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

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

<pre>
    Clang supports `-u` as a linker flag that accepts an argument: https://github.com/llvm/llvm-project/blob/aa5bc41b765694696ff05c3448247f7525577657/clang/include/clang/Driver/Options.td#L4258

Clang handles that option as a `JoinedOrSeparate` option which means that there does not need to be whitespace or an `=` between the option and the argument.

The end result of this is that any unknown command line option that starts with `-u` is accepted with a warning rather than diagnosed as an error: https://godbolt.org/z/74srP9Ysj

This turns out to break `check_cxx_compiler_flag` in CMake, which says that Clang supports any command line option that starts with `-u`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU81unDAQfhq4WFmxBkM4cNgk6qFqlUrtpadosIfFWa-NbJNN-vQdwybZVlWlSIBtZjz-fjy9Uy_drQG7Z2GeJudjYFldXM30YRAYMKPtAT0bDOxZHCEykBInSgPLwO_nI9qYlTs2xjgFmmT8Ez17Hce530h3pIUxT6_D1eTdI8pIy964ngYA0ctq2ze1qNuqbuthKIQsq-qaV83QCC5EQ7GGUmXCSaO20swKL_7cef2Enib3U9TOhk1UGS-_VFxcZ8VdVuzW70p0BKsMhpWNWzasVInzZ6ctqnv_HSfwEDHJcE45jVqO7Ihgz1vjiB6ZclTKusgsomLRsR5TasQwgUTmfBKKymTlXSrWYzwh2rT57WyrluWrmptLyD8ogJTgMcyG4A6UqgPTZwxgX9hsD9adLCOxj6kWOfZWe0kKEZKvJ_Lk3VyqsDpJqJcIsBN4q0kgIk7U0l7LlIa9dYGSYLEcvXf-H3471TsTN84nO37R21TBf2t_hsc_2STgsycJ3RwXtTzCIaGSI8rDg3x-fiAekzboH9KdW6BadvsVDmT47dmFAC9nAf66u0mPD-mwybHb1unulS2vc9WVimaQRx0NnjtjAG1CAruQZ1TuP5KHi7PWo67mfPam-3CD6BBmDDQR12XV5GOn-lYAlFWpODZ1K7ms64GLfhBC8rYWuYEeTegycZNxvvZGuVPn3uBJvsv_q7NRy5CC4i7XHS843xbbkheV4PVGtHwYSlnWoi0U32JWFXgkMTYJafI6990Cup_3gYJGhxjegxCC3lNbLICoPsxxdL7bgXf2Bowh6fKFZLcw_A2PtoHL">