Skip to content

[WebAssembly] __has_attribute(musttail) evaluates to true even when musttail is unsupported #163256

@ahatanak

Description

@ahatanak

$ cat test.cpp

#if __has_attribute(musttail) #warning HAS IT #else #warning DOES NOT HAVE #endif void F(void) { [[clang::musttail]] return F(); }
$ clang++ -std=c++20 -target wasm32-unknown-unknown -c test.cpp test.cpp:2:2: warning: HAS IT [-W#warnings]  2 | #warning HAS IT  | ^ test.cpp:6:6: error: WebAssembly 'tail-call' feature not enabled  6 | void F(void) { [[clang::musttail]] return F(); }  | ^ 1 warning and 1 error generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:WebAssemblyclang:frontendLanguage frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions