This is a very crude attempt to fix the diagnostic marker order ('note: previous declaration here' pointing to a source location before the main error marker) from D48100.
Approach:
- After parsing, remove all attributes from the new declaration
- Merge-in all inherited attributes (since the Decl's attribute list is empty, this should not result in any message)
- Merge-in the previously removed parsed attributes again
This ensures that
- Inherited attributes are listed before all non-inherited attributes (and corresponds textual order)
- Attribute merging happens the same way as adding a new attribute to the currently parsed declaration's attribute list
Patch is unfinished and ugly