[PATCH] D23895: [ms] Add support for parsing uuid as a MS attribute
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 29 11:00:42 PDT 2016
rnk added a comment.
The code looks good and I'm happy to leave the naming as it is for now. Apparently MSVC is warning on these attributes and calling them "ATL attributes" now: https://msdn.microsoft.com/en-us/library/mt723604.aspx I'm not sure if that warning applies to all square-bracketed user defined attributes or not, but the naming is certainly confusing.
Even though this change doesn't change the behavior of the parser, I would feel more comfortable if we added a new test at test/SemaCXX/ms-square-bracket-attributes.cpp or something that exhaustively lists the ambiguities we know about and codifies how we diagnose them. That way, if someone accidentally changes behavior in this area, we'll know about it. This seems like a good starting point for the test:
void local_class() {
// FIXME: MSVC accepts, but we reject due to ambiguity.
// expected-error at +1 {{expected body of lambda expression}}
[uuid("a5a7bd07-3b14-49bc-9399-de066d4d72cd")] struct Local {
int x;
};
}
void useit(int);
int lambda() {
int uuid = 42;
[uuid]() {
useit(uuid);
}();
}
https://reviews.llvm.org/D23895
More information about the cfe-commits
mailing list