Specialize value_cast error message for Ada
authorTom Tromey <tromey@adacore.com>
Tue, 18 Jun 2019 14:59:00 +0000 (08:59 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 10 Jul 2019 18:18:39 +0000 (12:18 -0600)
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  <tromey@adacore.com>

* valops.c (value_cast): Specialize error message for Ada.

gdb/ChangeLog
gdb/valops.c

index c4db196..410a8d8 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-10  Tom Tromey  <tromey@adacore.com>
+
+       * valops.c (value_cast): Specialize error message for Ada.
+
 2019-07-10  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * breakpoint.c (breakpoint_1): Update doc and parameter names.
index 663edae..82b5456 100644 (file)
@@ -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;
     }
 }