This patch (for C) is setting c_inhibit_evaluation_warnings and in_remove_qualifiers and doing corresponding use of pop_maybe_used, but I don't see the need for that. Expressions within the argument to __remove_qualifiers are evaluated exactly if they would be evaluated in the containing context; it's not like sizeof or typeof (expression) which can cause expressions not to be evaluated. (I don't actually think any of that handling is needed for typeof (type) either, it simply happens that the initial adjustments of c_inhibit_evaluation_warnings and in_typeof are done in code shared by typeof (expression) and typeof (type).)
-- Joseph S. Myers jos...@codesourcery.com