aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/arith.c
diff options
context:
space:
mode:
authorPaul Brook <pbrook@gcc.gnu.org>2005-01-23 22:29:41 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2005-01-23 22:29:41 +0000
commit69029c61aa94cec4fb273dcfc7693f754d9b4452 (patch)
tree482560991382bf4a800f1c23734d475bd99bc65d /gcc/fortran/arith.c
parent708bde14eaf5568ecc2fdb23a4cb15762f117f7c (diff)
downloadgcc-69029c61aa94cec4fb273dcfc7693f754d9b4452.zip
gcc-69029c61aa94cec4fb273dcfc7693f754d9b4452.tar.gz
gcc-69029c61aa94cec4fb273dcfc7693f754d9b4452.tar.bz2
re PR fortran/17941 (gfortran: parser chokes on complex literal constant)
2004-01-23 Paul Brook <paul@codesourcery.com> Steven G. Kargl <kargls@comcast.net> PR fortran/17941 * arith.c (gfc_convert_real): Remove sign handling. * primary.c (match_digits): Allow whitespace after initial sign. (match_real_const): Handle signs here. Allow whitespace after initial sign. Remove dead code. (match_const_complex_part): Remove. (match_complex_part): Use match_{real,integer}_const. (match_complex_constant): Cross-promote integer types. testsuite/ * gfortran.dg/real_const_1.f: New test. * gfortran.dg/real_const_2.f90: New test. * gfortran.dg/complex_int_1.f90: New test. From-SVN: r94127
Diffstat (limited to 'gcc/fortran/arith.c')
-rw-r--r--gcc/fortran/arith.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index eff7e90..924eea0 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1928,15 +1928,9 @@ gfc_expr *
gfc_convert_real (const char *buffer, int kind, locus * where)
{
gfc_expr *e;
- const char *t;
e = gfc_constant_result (BT_REAL, kind, where);
- /* A leading plus is allowed in Fortran, but not by mpfr_set_str */
- if (buffer[0] == '+')
- t = buffer + 1;
- else
- t = buffer;
- mpfr_set_str (e->value.real, t, 10, GFC_RND_MODE);
+ mpfr_set_str (e->value.real, buffer, 10, GFC_RND_MODE);
return e;
}