aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/expop.h5
-rw-r--r--gdb/testsuite/gdb.base/cast-indirection.exp5
2 files changed, 4 insertions, 6 deletions
diff --git a/gdb/expop.h b/gdb/expop.h
index 1967d97..2d46a9d 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -1513,11 +1513,8 @@ public:
struct expression *exp,
enum noside noside) override
{
- struct type *pointer_to_expect_type = (expect_type != nullptr
- ? lookup_pointer_type (expect_type)
- : nullptr);
value *val
- = std::get<0> (m_storage)->evaluate (pointer_to_expect_type, exp, noside);
+ = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
return eval_op_ind (expect_type, exp, noside, val);
}
diff --git a/gdb/testsuite/gdb.base/cast-indirection.exp b/gdb/testsuite/gdb.base/cast-indirection.exp
index d2c6d58..7b9b5a5 100644
--- a/gdb/testsuite/gdb.base/cast-indirection.exp
+++ b/gdb/testsuite/gdb.base/cast-indirection.exp
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check that "p (char)*a_loc ()" is handled as "p (char)*(char *)a_loc ()".
+# Check that "p (char)*a_loc ()" is handled correctly.
standard_testfile
@@ -37,4 +37,5 @@ gdb_test "p *(char *)a_loc ()" " = 97 'a'"
gdb_test "p (char)*(char *)a_loc ()" " = 97 'a'"
# Regression test for PR31693.
-gdb_test "p (char)*a_loc ()" " = 97 'a'"
+gdb_test "p (char)*a_loc ()" \
+ "'a_loc' has unknown return type; cast the call to its declared return type"