aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cxx-pretty-print.c
diff options
context:
space:
mode:
authorDouglas Gregor <doug.gregor@gmail.com>2007-07-27 17:43:05 +0000
committerDoug Gregor <dgregor@gcc.gnu.org>2007-07-27 17:43:05 +0000
commit3ad6a8e12ca4ac15b759f6a407d2ca2ea32e17a2 (patch)
tree1fd8c965b4122258e1d88e04db3ecb09a3757908 /gcc/cp/cxx-pretty-print.c
parent8a67955f0815ecf2892c635ca4128a5f414eb507 (diff)
downloadgcc-3ad6a8e12ca4ac15b759f6a407d2ca2ea32e17a2.zip
gcc-3ad6a8e12ca4ac15b759f6a407d2ca2ea32e17a2.tar.gz
gcc-3ad6a8e12ca4ac15b759f6a407d2ca2ea32e17a2.tar.bz2
typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes. * cp-tree.def (DECLTYPE_TYPE): New. * error.c (dump_type): Dump DECLTYPE_TYPE nodes. (dump_type_prefix): Ditto. (dump_type_suffix): Ditto. * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes. * mangle.c (write_type): Handle DECLTYPE_TYPE. * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate types. (DECLTYPE_TYPE_EXPR): New. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New. (finish_declared_type): Declare. * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print DECLTYPE_TYPE nodes. (pp_cxx_type_id): Ditto. * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children. (tsubst): Substitute into a DECLTYPE_TYPE node. (tsubst_copy): Ditto. (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE nodes. (dependent_type_p_r): DECLTYPE_TYPE types are always dependent. * semantics.c (finish_typeof): TYPEOF_TYPE types need to use structural equality (because we can't hash the expressions). (finish_declared_type): New. * lex.c (reswords): Add "decltype" keyword. * parser.c cp_lexer_next_token_is_decl_specifier_keyword (cp_parser_postfix_expression): Add member_access_only_p to restrict postfix expression to member access expressions. (cp_parser_unary_expression): Update call to cp_parser_postfix_expression to reflect new parameter. (cp_parser_declared_type): New. (cp_parser_simple_type_specifier): Parse decltype types. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * c-common.h (enum rid): Add RID_DECLTYPE, update RID_LAST_CXX0X. 2007-07-27 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/decltype1.C: New. * g++.dg/cpp0x/decltype2.C: New. * g++.dg/cpp0x/decltype3.C: New. * g++.dg/cpp0x/decltype4.C: New. * g++.dg/cpp0x/decltype5.C: New. * g++.dg/cpp0x/decltype6.C: New. From-SVN: r126991
Diffstat (limited to 'gcc/cp/cxx-pretty-print.c')
-rw-r--r--gcc/cp/cxx-pretty-print.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index ac75e1d..9717969 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -1198,6 +1198,13 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
pp_cxx_nested_name_specifier (pp, TYPE_METHOD_BASETYPE (t));
break;
+ case DECLTYPE_TYPE:
+ pp_cxx_identifier (pp, "decltype");
+ pp_cxx_left_paren (pp);
+ pp_cxx_expression (pp, DECLTYPE_TYPE_EXPR (t));
+ pp_cxx_right_paren (pp);
+ break;
+
default:
if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
pp_c_specifier_qualifier_list (pp_c_base (pp), t);
@@ -1581,6 +1588,7 @@ pp_cxx_type_id (cxx_pretty_printer *pp, tree t)
case TEMPLATE_PARM_INDEX:
case TEMPLATE_DECL:
case TYPEOF_TYPE:
+ case DECLTYPE_TYPE:
case TEMPLATE_ID_EXPR:
pp_cxx_type_specifier_seq (pp, t);
break;