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

    <tr>
        <th>Summary</th>
        <td>
            [clang-cl] Due to #pragma function, no_builtin attribute is incorrectly added to functions
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Consider the following example (due to the selected function name, this example is arm64 specific):
```
extern "C" __inline float __cdecl fabsf(  float _X);
#pragma function(fabsf)
  __inline float __cdecl fabsf(  float _X)
{
 return 0;
}

struct A {
    int foo() = delete;
    A() = default;
};

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

This gets successfully compiled with arm64 latest (14.41) MSVC.

However, with clang (with `-fms-compatibility`), the following errors occur:
```
error: no_builtin attribute has no effect on defaulted or deleted functions
error: no_builtin attribute has no effect on defaulted or deleted functions
2 errors generated.
Compiler returned: 1
```

See: https://godbolt.org/z/5venjbo1q

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VEGP4jgT_TXOpQRKKiGQQw4MCH2X79Sr0d6QY1cSjxybtSv09P76lUOanl7NjrSHlZCxcb1X5XqPkjGawRG1YvdF7M6ZnHn0of1qpTaTCS-jGs3gLd2zzuu39uRdNJoC8EjQe2v9q3ED0Hc53SyBwIOeCdgv95EsKSYN_ewUG-_AyYkEnoBHE58gE0GGqa4g3kiZ3iiBjSiPIj-L_CjqfP0sR_rOFBwIxJNAhOvVOGscQW-9ZLhelSZloZdd7AUe4P333xfKLysllrcgh0k-6xJ4WCHNIwT-HfODdr_yQyCeg4P8I-P-vG6WNXKYFcMRPiAAYBxD773Ag8AGRHkGTZaYniwp6Pjpupez5U9ZnvtlTZSTNO4d9GO6XxT5ueWP9bek2EAcIc5KUYz9bO0bKD_djCUNr4bHVUYrmSInLxTVtipS5v-_fD1tf6T7n3-lO4XkhQWprHRDgiwnUeebfoqbxC7ZdMYafksFYfNwzyfvheBDBK_UHP7RNilGlEdw_trNxrJxIJmD6WYmGGUE54H6nhSDd--dJQ0-rCp8mDj-Z5T4_paBHAXJpNeenR5dDqtopFPe4hdqvRClkJH5FlNP8CLwMnjdectbHwaBlz8FXnZ3ct86X_zxQGW6LXVTNjKjttiXRZ1jXh2ysd3vsM5VkUssuqbSuy6Xu73q86ZDhVjtM9NijlVRFFVRl1V-2MpCN7nSkhTWfVkdRJXTJI3dWnufUgWZiXGmtihq3NWZlR3ZuMwgREevsNwKxDSSQptAm24eoqhyayLHDxo2bJfhtThoo6zYneH8mEE_-6Offq6XiWCc8iGQYvsGUmvSieKpUDYH2_6tn4bHudsqPwm8pILWr80t-G-kWOBleUYUeFnfeW_xrwAAAP__l7GvlQ">