aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-03-15 17:26:47 +0000
committerTom Tromey <tromey@redhat.com>2010-03-15 17:26:47 +0000
commit6e31430b7070860436f93153ee1f8d832ca8b7ca (patch)
treebec489b7843e1af0ec6ae4a5b186774c0a509948 /gdb/c-exp.y
parent0f4b045ab1d08ebb204724491ad9797e9ecb5c87 (diff)
downloadgdb-6e31430b7070860436f93153ee1f8d832ca8b7ca.zip
gdb-6e31430b7070860436f93153ee1f8d832ca8b7ca.tar.gz
gdb-6e31430b7070860436f93153ee1f8d832ca8b7ca.tar.bz2
gdb
* c-exp.y (name_not_typename): Add 'operator' clause. gdb/testsuite * gdb.cp/userdef.exp: Add tests for explicit calls to operator==. * gdb.cp/userdef.cc (operator==): New function. (main): New locals mem1, mem2.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 1af76c9..2577a99 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1236,6 +1236,14 @@ name_not_typename : NAME
context where only a name could occur, this might be useful.
| NAME_OR_INT
*/
+ | operator
+ {
+ $$.stoken = $1;
+ $$.sym = lookup_symbol ($1.ptr,
+ expression_context_block,
+ VAR_DOMAIN,
+ &$$.is_a_field_of_this);
+ }
;
%%