Commit Graph

2 Commits

Author SHA1 Message Date
Aaron Ballman 5d3dca24aa Ignore unknown attribute warnings in this test
We're testing the parsing behavior, not the actual attributes used, and
the attribute name cannot be elided for __declspec attributes.
2021-01-27 15:45:35 -05:00
Aaron Ballman 9f2c7effd7 Parse different attribute syntaxes in arbitrary order
In Clang today, we parse the different attribute syntaxes
(__attribute__, __declspec, and [[]]) in a fairly rigid order. This
leads to confusion for users when they guess the order incorrectly,
and leads to bug reports like PR24559 or necessitates changes like
D94788.

This patch adds a helper function to allow us to more easily parse
attributes in arbitrary order, and then updates all of the places
where we would parse two or more different syntaxes in a rigid order to
use the helper method. The patch does not attempt to handle Microsoft
attributes ([]) because those are ambiguous with other code constructs
and we don't have any attributes that use the syntax.
2021-01-27 15:30:15 -05:00