diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-02-18 19:10:48 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-02-18 19:10:48 +0000 |
commit | eeaafae2bdf07efbe757579c966da3c422496053 (patch) | |
tree | 791125207010daae2e96bcfc9d9de5cfba24201c /gdb/valarith.c | |
parent | ae97b9228de63b9496cad36aff26742bea32e2e1 (diff) | |
download | gdb-eeaafae2bdf07efbe757579c966da3c422496053.zip gdb-eeaafae2bdf07efbe757579c966da3c422496053.tar.gz gdb-eeaafae2bdf07efbe757579c966da3c422496053.tar.bz2 |
gdb/
* cp-support.c (make_symbol_overload_list_namespace): Do not call
make_symbol_overload_list_block with NULL BLOCK.
* valarith.c (unop_user_defined_p): Resolve also TYPE_CODE_TYPEDEF.
gdb/testsuite/
* gdb.cp/typedef-operator.exp: New file.
* gdb.cp/typedef-operator.cc: New file.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r-- | gdb/valarith.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c index 787fc69..68f649f 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -315,15 +315,9 @@ unop_user_defined_p (enum exp_opcode op, struct value *arg1) if (op == UNOP_ADDR) return 0; type1 = check_typedef (value_type (arg1)); - for (;;) - { - if (TYPE_CODE (type1) == TYPE_CODE_STRUCT) - return 1; - else if (TYPE_CODE (type1) == TYPE_CODE_REF) - type1 = TYPE_TARGET_TYPE (type1); - else - return 0; - } + if (TYPE_CODE (type1) == TYPE_CODE_REF) + type1 = check_typedef (TYPE_TARGET_TYPE (type1)); + return TYPE_CODE (type1) == TYPE_CODE_STRUCT; } /* Try to find an operator named OPERATOR which takes NARGS arguments |