diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-19 15:38:15 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-19 15:38:15 +0000 |
commit | a23fa27d5a315b7801bb925a2a99e871f8832bb3 (patch) | |
tree | c7e50145a6ae85d0550495f5395ef2bf6d6ae72c /gdb/varobj.c | |
parent | 2295b9bae645c263f07ad38ac327b515b24678ff (diff) | |
download | gdb-a23fa27d5a315b7801bb925a2a99e871f8832bb3.tar.gz |
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/varobj.c')
-rw-r--r-- | gdb/varobj.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c index 42e2ce4f3bd..99b158efcfd 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -675,7 +675,9 @@ varobj_create (char *objname, } /* Don't allow variables to be created for types. */ - if (var->root->exp->elts[0].opcode == OP_TYPE) + if (var->root->exp->elts[0].opcode == OP_TYPE + || var->root->exp->elts[0].opcode == OP_TYPEOF + || var->root->exp->elts[0].opcode == OP_DECLTYPE) { do_cleanups (old_chain); fprintf_unfiltered (gdb_stderr, "Attempt to use a type name" |