Nathan-Huckleberry added a comment.
void foo() {
__attribute__((address_space(0))) *x;
*y;
}
If the attributes are parsed then the rest of the statement is identical to:
{
*x; //this one has attributes now
*y;
{
The first line should be a valid declaration and the second like should be a
dereference of an uninitialized variable. If the attributes token is discarded
before parsing the rest of the line the only way to differentiate these is by
looking at the attributes added to them.
An alternative may be parse the attributes list and immediately try to parse as
a declaration then if that parsing fails attempt to parse as something else.
Although this approach also has the scary implication of things that are
supposed to be declarations getting reparsed as something entirely different.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64838/new/
https://reviews.llvm.org/D64838
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits