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

    <tr>
        <th>Summary</th>
        <td>
            With gcc-12's libstdc++, clang-15 rc2 still cannot compile CUDA/HIP code because of __noinline__
        </td>
    </tr>

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

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

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

<pre>
    Although https://reviews.llvm.org/D124866 aims to fix bugs such as https://github.com/NVIDIA/thrust/issues/1703 or https://bugs.gentoo.org/857126

However when I tried clang-15 rc2, the issue still exists.

Reproduce method:

pure C++ test.C
```c++
#define __noinline__ __attribute__((noinline))
#include<future>

int main()
{
        return 0;
}
```

Run `clang++ test.C`

HIP code example test.hip
```c++
#include <hip/hip_runtime.h>
#include<future>

int main()
{
        return 0;
}
```
Run `clang++ -nogpulib -nogpuinc -x hip test.hip`

Both gives error: `g++-v12/bits/shared_ptr_base.h:196:22: error: use of undeclared identifier 'noinline'; did you mean 'inline'?`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VE2PmzAQ_TVwGQWBCSQcOGSTrjaXqqrU9hgZPIArsCN_JNt_33FCdpNV1d6KLGMznvF7w5tptPhVb0Y3aN8PMDh3tFG-idgzDYMniWebjONpSrTp6dMuY8t1WQKXkwWnoZOv0PjegvXtANx-iNBLN_gmafVEm8_f97t9MLjBeOtoIa31aGmRrdIctPngHQInPSqn9Xz9ulhlrIzSXZRurvOLPuMJDZwHVLAHZyQKaEeu-kVWgGlZxLbgBoTLXWCdHEfAV2mdTe7jfMWj0cK3CBNSMkQAcWc-eoOwjdgTDXBoXbKdzWV6He3VOH9lucBOKoTDQWmpRloeDrThjhA23tEuYmsaN2vEqjBu3lK1oxcY5dvOO7o7yj_dw5HKwcSlusS4ea3my2F-DJKngjTKb6hWuw-gHzLgFQQeIXePRB_Pvey_QKsFUhb5dBzxemqQx38kZKYExCkcZs80H4xXTk6YDO8E_zP5P9BeKN0f_SibeUV4YPEKhPed62NOnrQboJcntIDGaEPqCUHngItTxoKcpQtatwM3KA5HZw4Ntxfqm6wqaWYs-L0F8BZBd-CVQEJHPiAFFYPsJOk9Yqt36ayIJQgp4Jf2pF-ugvnO-ExYYqyzsmQsW2dVEYs6F1Ve8dhJN2L9Qwb8bbsIQFcWiLt14vYHqYLuK2ouopYrpR1JYTpKUsH22y6U7Zs6Gmz5zOC-BmJvxvovTSL0mvm1oIr8ie1DoyhWxXIZD3VRFUW6LtZs3XRdvkRWYZ41HeKy6kSLZTzyBkdbR8VTVOxiWbOUsbRK86zIyrxIsrQrqpQvm4JxIbIiWqZImhrfel1s6guG0IPIOF4axpuRWyt7hXiLzz31DPKQjrJ59oywxRfM9QXwbyIcmyM">