http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2012-04-23 21:11:33 UTC --- On Tue, 17 Apr 2012, manu at gcc dot gnu.org wrote: > Unfortunately, I cannot see any way to know that FOO is a constant that comes > from an enum. Joseph, is this possible to do in the C FE? The original types of expressions that came from enums are already tracked for use of -Wc++-compat (checking if C code is compatible with stricter C++ rules for enums). (This is what c-typeck.c:build_external_ref uses the type pointer for: storing the original type of an enum.) So the information is available in at least parts of the C front end.