Currently, when one or more attributes are mutually exclusive, the developer adding the attribute has to manually emit diagnostics. In practice, this is highly error prone, especially for declaration attributes, because such checking is not trivial. Redeclarations require you to write a "merge" function to diagnose mutually exclusive attributes and most attributes get this wrong.
This patch introduces a table-generated way to specify that a group of two or more attributes are mutually exclusive: def : MutualExclusions<[Attr1, Attr2, Attr3]>;
This works for both statement and declaration attributes (but not type attributes) and the checking is done either from the common attribute diagnostic checking code or from within mergeDeclAttribute() when merging redeclarations.