KEMBAR78
[clang-cl] Due to #pragma function, no_builtin attribute is incorrectly added to functions · Issue #116256 · llvm/llvm-project · GitHub
Skip to content

[clang-cl] Due to #pragma function, no_builtin attribute is incorrectly added to functions #116256

@VladimirShchigolev

Description

@VladimirShchigolev

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

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions