tree-sitter / tree-sitter-c

C grammar for tree-sitter
MIT License
225 stars 100 forks source link

bug: alignas() / _Alignas() not supported #206

Closed Mango0x45 closed 3 months ago

Mango0x45 commented 4 months ago

Did you check existing issues?

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

No response

Describe the bug

The grammar is missing support for the _Alignas() type specifier (or alignas() in C23). Documentation for it is found here: https://en.cppreference.com/w/c/language/_Alignas

Steps To Reproduce/Bad Parse Tree

Expected Behavior/Parse Tree

I expected the alignas() type specifier to not be treated as a function.

Repro

int
main(void)
{
    _Alignas(16)  int a;
    _Alignas(int) int b;
    alignas(16)   int c;
    alignas(int)  int d;
}