+2007-10-04 Tobias Schlüter <tobi@gcc.gnu.org>
+
+ PR fortran/33626
+ * resolve.c (resolve_operator): Always copy the type for
+ expressions in parentheses.
+
2007-10-04 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33542
goto bad_op;
case INTRINSIC_PARENTHESES:
+ e->ts = op1->ts;
+ if (e->ts.type == BT_CHARACTER)
+ e->ts.cl = op1->ts.cl;
break;
default:
break;
case INTRINSIC_PARENTHESES:
-
- /* This is always correct and sometimes necessary! */
- if (e->ts.type == BT_UNKNOWN)
- e->ts = op1->ts;
-
- if (e->ts.type == BT_CHARACTER && !e->ts.cl)
- e->ts.cl = op1->ts.cl;
-
case INTRINSIC_NOT:
case INTRINSIC_UPLUS:
case INTRINSIC_UMINUS:
--- /dev/null
+! { dg-do run }
+! PR fortran/33626
+! Types were not always propagated correctly
+ logical(kind=1) :: i, j
+ integer(kind=1) :: a, b
+ character*1 :: c, d
+ if (any( (/ kind(i .and. j), kind(.not. (i .and. j)), kind((a + b)), &
+ kind((42_1)), kind((j .and. i)), kind((.true._1)), &
+ kind(c // d), kind((c) // d), kind((c//d)) /) /= 1 )) call abort()
+ if (any( (/ len(c // d), len((c) // d), len ((c // d)) /) /= 2)) call abort()
+end