The commit improves the AST print output of function attributes. In the previous version, all attributes were output after the function declaration. This is correct for most attributes but e.g. not for [[noreturn]]. Now it is decided for each attribues if it should be output before or after function declaration. It follows the following rule:
- All [[...]] attributes are placed before declaration
- __declspec attributes are placed before declaration as requested by Microsoft ... https://learn.microsoft.com/en-us/cpp/cpp/declspec?view=msvc-170
- Some keyword are placed after the declaration
- Without a function body attributes are placed after declaration
- With a function body attributes are placed before declaration because GCC produces are error and Clang a warning otherwise
@aaron.ballman @erichkeane
Is this enough to describe the position of the attribute kind, or should it go for a tblgen approach, as I did in D141714? This here looks much cleaner than the tblgen IMHO.