PR exp/13206:

* ax-gdb.c (gen_expr) <OP_TYPEOF, OP_DECLTYPE>: New cases.
	* breakpoint.c (watchpoint_exp_is_const) <OP_TYPEOF,
	OP_DECLTYPE>: New cases.
	* c-exp.y (TYPEOF, DECLTYPE): New tokens.
	(type_exp): Add new productions.
	(ident_tokens): Add __typeof__, typeof, __typeof, __decltype,
	and decltype.
	* eval.c (evaluate_subexp_standard) <OP_TYPEOF, OP_DECLTYPE>:
	New case.
	* expprint.c (dump_subexp_body_standard) <OP_TYPEOF,
	OP_DECLTYPE>: New case.
	* parse.c (operator_length_standard) <OP_TYPEOF, OP_DECLTYPE>:
	New case.
	* std-operator.def (OP_TYPEOF, OP_DECLTYPE): New constants.
	* varobj.c (varobj_create): Handle OP_TYPEOF, OP_DECLTYPE.
gdb/testsuite
	* gdb.cp/casts.exp: Add tests for typeof and decltype.
	* gdb.cp/casts.cc (decltype): New function.
	(main): Use it.
This commit is contained in:
Tom Tromey
2012-07-19 15:38:18 +00:00
parent 274b54d7e2
commit 608b49672e
12 changed files with 140 additions and 2 deletions

View File

@ -938,6 +938,8 @@ operator_length_standard (const struct expression *expr, int endpos,
case UNOP_ODD:
case UNOP_ORD:
case UNOP_TRUNC:
case OP_TYPEOF:
case OP_DECLTYPE:
oplen = 1;
args = 1;
break;