diff options
author | Hannes Domani <ssbssa@yahoo.de> | 2020-03-31 14:49:06 +0200 |
---|---|---|
committer | Hannes Domani <ssbssa@yahoo.de> | 2020-04-01 19:15:03 +0200 |
commit | 60e22c1eacb0df32aeeeb78c53cfd46c53a3770f (patch) | |
tree | e9870fa9aee3159d44e48cffce61f0d85abf8318 /gdb/tui/tui-command.c | |
parent | 77bf7b5317195e092a9f18fef993c412e2e05f53 (diff) | |
download | gdb-60e22c1eacb0df32aeeeb78c53cfd46c53a3770f.zip gdb-60e22c1eacb0df32aeeeb78c53cfd46c53a3770f.tar.gz gdb-60e22c1eacb0df32aeeeb78c53cfd46c53a3770f.tar.bz2 |
Allow pointer arithmetic with integer references
Considering these variables:
int i = 3;
int &iref = i;
It's not possible to do any pointer arithmetic with iref:
(gdb) p &i+iref
Argument to arithmetic operation not a number or boolean.
So this adds checks for references to integers in pointer arithmetic.
gdb/ChangeLog:
2020-04-01 Hannes Domani <ssbssa@yahoo.de>
PR gdb/24789
* eval.c (is_integral_or_integral_reference): New function.
(evaluate_subexp_standard): Allow integer references in
pointer arithmetic.
gdb/testsuite/ChangeLog:
2020-04-01 Hannes Domani <ssbssa@yahoo.de>
PR gdb/24789
* gdb.cp/misc.cc: Add integer reference variable.
* gdb.cp/misc.exp: Add test.
Diffstat (limited to 'gdb/tui/tui-command.c')
0 files changed, 0 insertions, 0 deletions