Pretty printing c11 _Noreturn attribute

Hi all,

When I’m pretty printing from AST a function with c11 _Noreturn function specifier, it is printed as an attribute, i.e. at the end of function declaration, but it should be at the front and thus code is uncompilable.

Original code. Compiles

Hi all,

When I’m pretty printing from AST a function with c11 _Noreturn function specifier, it is printed as an attribute, i.e. at the end of function declaration, but it should be at the front and thus code is uncompilable.

Original code. Compiles

----------------------
_Noreturn void foo(){
  abort();
}

int main() {}
----------------------

Same code parsed by Clang and pretty printed via TranslationUnitDecl::Print():

----------------------
void foo() _Noreturn { // error: '_Noreturn' keyword must precede function declarator
  abort();
}

int main() {}
----------------------

This happens, because C11 _Noreturn is considered to be function attribute in Clang internals, while in standard it is defined, as function-specifier just like “inline”

Is this behaviour desired or it is a bug?

That's a bug with the pretty printer. It's not paying attention to
whether the attribute was spelled as a keyword or not.

~Aaron