2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/56520
* match.c (gfc_match_name): Special case unary minus and plus.
2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/56520
* gfortran.dg/pr56520.f90: New test.
From-SVN: r225349
+2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/56520
+ * match.c (gfc_match_name): Special case unary minus and plus.
+
2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66545
c = gfc_next_ascii_char ();
if (!(ISALPHA (c) || (c == '_' && flag_allow_leading_underscore)))
{
- if (!gfc_error_flag_test () && c != '(')
+ /* Special cases for unary minus and plus, which allows for a sensible
+ error message for code of the form 'c = exp(-a*b) )' where an
+ extra ')' appears at the end of statement. */
+ if (!gfc_error_flag_test () && c != '(' && c != '-' && c != '+')
gfc_error ("Invalid character in name at %C");
gfc_current_locus = old_loc;
return MATCH_NO;
+2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/56520
+ * gfortran.dg/pr56520.f90: New test.
+
2015-07-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/66545
--- /dev/null
+! { dg-do compile }
+! PR fortran/56520
+!
+program misleading
+ implicit none
+ real a, c
+ a = 1.0
+ c = exp(+a) ) ! { dg-error "Unclassifiable statement" }
+ c = exp(-a) ) ! { dg-error "Unclassifiable statement" }
+ c = exp((a)) ) ! { dg-error "Unclassifiable statement" }
+ c = exp(a) ) ! { dg-error "Unclassifiable statement" }
+ c = exp(a)
+end program misleading