From 32372d80caba2e223157eca6db2fb0e65369c3c7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 18 Jun 2019 08:59:00 -0600 Subject: [PATCH] Specialize value_cast error message for Ada In Ada, the term for a cast is "type conversion". AdaCore has been carrying a local patch to specialize the error message in value_cast, but it seemed fine to me for this to be part of gdb. This also removes a dead "return" statement. gdb/ChangeLog 2019-07-10 Tom Tromey * valops.c (value_cast): Specialize error message for Ada. --- gdb/ChangeLog | 4 ++++ gdb/valops.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c4db196..410a8d8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2019-07-10 Tom Tromey + + * valops.c (value_cast): Specialize error message for Ada. + 2019-07-10 Simon Marchi * breakpoint.c (breakpoint_1): Update doc and parameter names. diff --git a/gdb/valops.c b/gdb/valops.c index 663edae..82b54561 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -555,8 +555,9 @@ value_cast (struct type *type, struct value *arg2) return value_at_lazy (to_type, value_address (arg2)); else { + if (current_language->la_language == language_ada) + error (_("Invalid type conversion.")); error (_("Invalid cast.")); - return 0; } } -- 2.7.4