Open llvmbot opened 8 years ago
The pretty printer does print in the wrong location, however, -ast-print
is a best-effort option and not something we require to work correctly as part of usual feature development (it's mostly a historical artifact and a debugging aid), so it's pretty low priority to fix this. It impacts all keyword-based attributes that can appertain to a function, not just _Noreturn
(e.g., __forceinline
has the same problem).
@llvm/issue-subscribers-clang-frontend
Extended Description
Pretty printing function declaration with C11 _Noreturn attribute yields uncompilable code, i.e.
_Noreturn void foo(){ abort(); }
int main() {}
If parsed by Clang and pretty printed via pretty printer:
void foo() _Noreturn { // error: '_Noreturn' keyword must precede function declarator abort(); }
int main() {}