Summary: | gdb thinks an int is not an int | ||
---|---|---|---|
Product: | gdb | Reporter: | Hi-Angel <hi-angel> |
Component: | c++ | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ssbssa, tromey |
Priority: | P2 | ||
Version: | 8.3 | ||
Target Milestone: | 10.1 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Hi-Angel
2019-07-09 07:44:28 UTC
The master branch has been updated by Hannes Domani <ssbssa@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60e22c1eacb0df32aeeeb78c53cfd46c53a3770f commit 60e22c1eacb0df32aeeeb78c53cfd46c53a3770f Author: Hannes Domani <ssbssa@yahoo.de> Date: Tue Mar 31 14:49:06 2020 +0200 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. Fixed. |