Skip to content

Clang doesn't accept simple braces inside a naked function #118196

@TheComputerGuy96

Description

@TheComputerGuy96

Godbolt example: https://godbolt.org/z/179z4fWc4

The braces in that example are basically a no-op (so why doesn't Clang accept them?)

__attribute__((naked)) int frog()
{
    { __asm__ volatile ("mov rax, 21\n" "ret"); }
}

int main(void)
{
    int toad = frog();
    return toad;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"inline-asmwontfixIssue is real, but we can't or won't fix it. Not invalid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions