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

    <tr>
        <th>Summary</th>
        <td>
            clang 18.1.8 fails to build on Ubuntu 22.04 - missing std::atomic - actual problem unguarded-availability-new
        </td>
    </tr>

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

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

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

<pre>
    This is a build problem.

I was trying to compile version 18.1.8 on Ubuntu 22.04
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04).

Strangely, the cmake build was failing with missing std::atomic.
That seemed way off since that is a basic requirement.
After digging into the logs, I found that the real issue was that the build system
thought that g++ supported -Werror=unguarded-availability-new.

The check in llvm/cmake/config-ix.cmake:

```
check_c_compiler_flag("-Werror=unguarded-availability-new" "C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW") 
```
Appears to be flawed.
I commented out the 3 following lines that set the CMAKE_REQUIRED_FLAGS to for this warning.

Once I did that, the build worked successfully.

Hopefully, this helps some others who encounter the same issue.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVN1uq0YXfZrhZssIBpvYF1yQ2D6f9aUnp07SqFdoGDYwzTBD5yeub_rs1QDRqaseqZJlND9rsVh77c2sFZ1CLMjmnmz2EfOu16ZojG-Mj2rdXIuXXlgQFhjUXsgGRqNriUNMkj1Jyvn_BBdmwZmrUB04DVwPo5AIH2is0ArSbZzGW9AKXmuvnAdK42Q9YzvOv99L43WcAKHb5d68sUr9tEz_nHF0d_P2Z2eY6lBeCX0A1yPwgb3jIjcIa5mQQdlFuB4GYW1YWNeQrCRZyZweBF8YX3rmwCIOGKBX0G0LViiO4MLJ7AOzgoPB370wOKByC7ZsHRpoRNcFfqGcntRI3dmg7ASt9qqZicKBQSZBWOtxtu9zfxZur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