From: Paolo Carlini Date: Mon, 25 Apr 2011 23:50:35 +0000 (+0000) Subject: c-common.c (struct c_common_resword): Add __underlying_type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74e883ce8c6be685132a1dbdbeb6257a7fd25e0d;p=gcc.git c-common.c (struct c_common_resword): Add __underlying_type. /gcc 2011-04-25 Paolo Carlini * c-family/c-common.c (struct c_common_resword): Add __underlying_type. * c-family/c-common.h (enum rid): Add RID_UNDERLYING_TYPE. * doc/extend.texi: Document __underlying_type. /cp 2011-04-25 Paolo Carlini * cp-tree.def: Add a new UNDERLYING_TYPE tree code. * cp-tree.h (enum cp_trait_kind): Add CPTK_UNDERLYING_TYPE, tidy. (UNDERLYING_TYPE_TYPE): Add. * cp-objcp-common.c (cp_common_init_ts): Mark UNDERLYING_TYPE as TS_COMMON. * parser.c (cp_lexer_next_token_is_decl_specifier_keyword, cp_parser_simple_type_specifier): Handle UNDERLYING_TYPE. (cp_parser_trait_expr): Deal with RID_UNDERLYING_TYPE; tidy. * semantics.c (finish_underlying_type): New. * typeck.c (structural_comptypes): Handle UNDERLYING_TYPE. * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise. * cxx-pretty-print.c (p_cxx_type_id): Likewise. * tree.c (cp_walk_subtrees): Likewise. * pt.c (for_each_template_parm_r, tsubst, unify, dependent_type_p_r): Likewise. * mangle.c (write_type): Sorry for __underlying_type. /testsuite 2011-04-25 Paolo Carlini * g++.dg/ext/underlying_type1.C: New. * g++.dg/ext/underlying_type2.C: Likewise. * g++.dg/ext/underlying_type3.C: Likewise. * g++.dg/ext/underlying_type4.C: Likewise. * g++.dg/ext/underlying_type5.C: Likewise. * g++.dg/ext/underlying_type6.C: Likewise. * g++.dg/ext/underlying_type7.C: Likewise. * g++.dg/ext/underlying_type8.C: Likewise. * g++.dg/ext/underlying_type9.C: Likewise. * g++.dg/ext/underlying_type10.C: Likewise. From-SVN: r172945 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 334ee8f6b86..69132f4bf05 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -3,6 +3,7 @@ * c-family/c-common.c (struct c_common_resword): Add __underlying_type. * c-family/c-common.h (enum rid): Add RID_UNDERLYING_TYPE. + * doc/extend.texi: Document __underlying_type. 2011-04-25 Segher Boessenkool diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 303a4c9dd1f..c0ea9d36b58 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -16,7 +16,6 @@ * pt.c (for_each_template_parm_r, tsubst, unify, dependent_type_p_r): Likewise. * mangle.c (write_type): Sorry for __underlying_type. - * doc/extend.texi: Document __underlying_type. 2011-04-25 Jason Merrill diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index eddff9539d0..3335196deae 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -14422,6 +14422,10 @@ type, (possibly cv-qualified) @code{void}, or an array of unknown bound. If @code{type} is a cv union type ([basic.compound]) the trait is true, else it is false. +@item __underlying_type (type) +The underlying type of @code{type}. Requires: @code{type} shall be +an enumeration type ([dcl.enum]). + @end table @node Java Exceptions