Christian pointed out that the value_literal_complex was still a bit
weird; this patch rewrites it and moves it to value.h.
gdb/ChangeLog
2020-04-01 Tom Tromey <tom@tromey.com>
* value.h (value_literal_complex): Add comment.
* valops.c (value_literal_complex): Refer to value.h.
+2020-04-01 Tom Tromey <tom@tromey.com>
+
+ * value.h (value_literal_complex): Add comment.
+ * valops.c (value_literal_complex): Refer to value.h.
+
2020-04-01 Tom Tromey <tom@tromey.com>
* c-exp.y (FLOAT_KEYWORD, COMPLEX): New tokens.
return slice;
}
-/* Create a value for a FORTRAN complex number. Currently most of the
- time values are coerced to COMPLEX*16 (i.e. a complex number
- composed of 2 doubles. */
+/* See value.h. */
struct value *
-value_literal_complex (struct value *arg1,
+value_literal_complex (struct value *arg1,
struct value *arg2,
struct type *type)
{
extern struct value *value_slice (struct value *, int, int);
+/* Create a complex number. The type is the complex type; the values
+ are cast to the underlying scalar type before the complex number is
+ created. */
+
extern struct value *value_literal_complex (struct value *, struct value *,
struct type *);