When a function parameter is declared __attribute__((cleanup)), neither Clang nor GCC actually executes the cleanup function, but Clang didn't warn about it. For the sake of compatibility, add a warning rather than making the attribute actually work.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
This looks fine to me, though it would be better to express the restrictions as a SubjectList on the attribute definition in include/clang/Basic/Attr.td rather than here in code.
Comment Actions
It would be nice, but the issue is the unwieldy list of diagnostic enumerations for custom subject lists. I would love to find a way to express the diagnostic replacement for %1 as part of tablegen instead of manually.
FWIW, this LGTM as well.
~Aaron