OSDN Git Service

gcc/fortran:
authordfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2007 19:05:58 +0000 (19:05 +0000)
committerdfranke <dfranke@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jun 2007 19:05:58 +0000 (19:05 +0000)
2007-06-29  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/31580
        * resolve.c (resolve_operator): Added check whether a user
defined operator is available.

gcc/testsuite:
2007-06-29  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/31580
* gfortran.dg/operator_3.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126117 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/operator_3.f90 [new file with mode: 0644]

index 3e314c0..57724bf 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-29  Daniel Franke  <franke.daniel@gmail.com>
+
+       * resolve.c (resolve_operator): Added check whether a user
+       defined operator is available.
+
 2007-06-29  Daniel Franke <franke.daniel@gmail.com>
 
        * openmp.c (resolve_omp_clauses): Adjust error message to
index bc6ba02..8cc0c42 100644 (file)
@@ -2251,7 +2251,9 @@ resolve_operator (gfc_expr *e)
       goto bad_op;
 
     case INTRINSIC_USER:
-      if (op2 == NULL)
+      if (e->value.op.uop->operator == NULL)
+       sprintf (msg, _("Unknown operator '%s' at %%L"), e->value.op.uop->name);
+      else if (op2 == NULL)
        sprintf (msg, _("Operand of user operator '%s' at %%L is %s"),
                 e->value.op.uop->name, gfc_typename (&op1->ts));
       else
index 7a7f212..447bcde 100644 (file)
@@ -1,5 +1,9 @@
 2007-06-29  Daniel Franke  <franke.daniel@gmail.com>
 
+       * gfortran.dg/operator_3.f90: New test.
+
+2007-06-29  Daniel Franke  <franke.daniel@gmail.com>
+
        * gfortran.dg/gomp/reduction1.f90: Adjust error message.
        * gfortran.dg/gomp/allocatable_components_1.f90: Likewise.
 
diff --git a/gcc/testsuite/gfortran.dg/operator_3.f90 b/gcc/testsuite/gfortran.dg/operator_3.f90
new file mode 100644 (file)
index 0000000..66f051d
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-compile }
+! PR fortran/31580
+!
+! Testcase contributed by Tobias Burnus <burnus AT gcc DOT gnu DOT org>
+!
+PROGRAM test
+  real :: a,b
+  if(a .nonex. b) stop       ! { dg-error "Unknown operator" }
+end program