diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-19 15:38:18 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-19 15:38:18 +0000 |
commit | 608b49672edd92191a25a2c365def9d2f4f51db7 (patch) | |
tree | 0ecad22ba0bdc2504d989da1742810ccc34a69b0 /gdb/std-operator.def | |
parent | 274b54d7e28ed7bb6c03c9d3a27b43151548b8af (diff) | |
download | gdb-608b49672edd92191a25a2c365def9d2f4f51db7.zip gdb-608b49672edd92191a25a2c365def9d2f4f51db7.tar.gz gdb-608b49672edd92191a25a2c365def9d2f4f51db7.tar.bz2 |
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.
Diffstat (limited to 'gdb/std-operator.def')
-rw-r--r-- | gdb/std-operator.def | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/std-operator.def b/gdb/std-operator.def index 9c6a01b..b013687 100644 --- a/gdb/std-operator.def +++ b/gdb/std-operator.def @@ -332,3 +332,12 @@ OP (OP_DECFLOAT) /* OP_ADL_FUNC specifies that the function is to be looked up in an Argument Dependent manner (Koenig lookup). */ OP (OP_ADL_FUNC) + +/* The typeof operator. This has one expression argument, which is + evaluated solely for its type. */ +OP (OP_TYPEOF) + +/* The decltype operator. This has one expression argument, which is + evaluated solely for its type. This is similar to typeof, but has + slight different semantics. */ +OP (OP_DECLTYPE) |