On 04/16/2010 08:57 PM, IainS wrote:
+ if (TREE_UNAVAILABLE (member))
+ error_unavailable_use (member, NULL_TREE);
+ else if (TREE_DEPRECATED (member))
warn_deprecated_use (member, NULL_TREE);
warn_deprecated_use is actually called only with the second parameter equal
to NULL.
So this means that you're effectively always looking up the attribute. You
can then use just one flag bit, and in warn_deprecated_use (maybe renamed to
diagnose_deprecated_use?) do either the deprecation warning or the
unavailability error. (Maybe you can also pass the deprecated_state to it,
or something like that).
Effectively, TREE_DEPRECATED will mean "deprecated or unavailable". This
should widely reduces the code duplication. (I haven't thought about
type_is_unavailable and how to eliminate that duplication, but hey, I don't
want to ruin the fun...)
Paolo