Nathan-Huckleberry added a comment. The main problem that we have is that the `__attribute__` token always causes the parser to read the line as a declaration. Then the declaration parser handles reading the attributes list.
This case demonstrates the problem: void foo() { __attribute__((address_space(0))) *x; } If the attribute token is read beforehand this code just becomes `*x` and is parsed as a dereference of an undefined variable when it should actually be a declaration. Maybe the best solution is to pull the attributes parsing out to `ParseStatementOrDeclaration` then pass those attributes through to following functions. When the determination is made whether a line is a declaration or a statement the attributes list can be looked at to determine if the attributes are statement or declaration attributes and continue accordingly. Maybe throwing a warning if mixing of declaration and statement attributes occur. Does that sound like a good solution? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64838/new/ https://reviews.llvm.org/D64838 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits