Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c	(Revision 184372)
+++ gcc/fortran/expr.c	(Arbeitskopie)
@@ -4648,7 +4648,8 @@ gfc_check_vardef_context (gfc_expr* e, bool pointe
      the component of sub-component of a pointer.  Obviously,
      procedure pointers are of no interest here.  */
   check_intentin = true;
-  ptr_component = sym->attr.pointer;
+  ptr_component = (sym->ts.type == BT_CLASS && CLASS_DATA (sym))
+		  ? CLASS_DATA (sym)->attr.class_pointer : sym->attr.pointer;
   for (ref = e->ref; ref && check_intentin; ref = ref->next)
     {
       if (ptr_component && ref->type == REF_COMPONENT)
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c	(Revision 184372)
+++ gcc/fortran/interface.c	(Arbeitskopie)
@@ -1579,7 +1579,9 @@ compare_pointer (gfc_symbol *formal, gfc_expr *act
 {
   symbol_attribute attr;
 
-  if (formal->attr.pointer)
+  if (formal->attr.pointer
+      || (formal->ts.type == BT_CLASS && CLASS_DATA (formal)
+	  && CLASS_DATA (formal)->attr.class_pointer))
     {
       attr = gfc_expr_attr (actual);
 
@@ -1706,10 +1708,11 @@ compare_parameter (gfc_symbol *formal, gfc_expr *a
 		   gfc_typename (&formal->ts));
       return 0;
     }
-    
-  /* F2008, 12.5.2.5.  */
+
+  /* F2008, 12.5.2.5; IR F08/0073.  */
   if (formal->ts.type == BT_CLASS
-      && (CLASS_DATA (formal)->attr.class_pointer
+      && ((CLASS_DATA (formal)->attr.class_pointer
+	   && !formal->attr.intent == INTENT_IN)
           || CLASS_DATA (formal)->attr.allocatable))
     {
       if (actual->ts.type != BT_CLASS)
Index: gcc/testsuite/gfortran.dg/class_51.f90
===================================================================
--- gcc/testsuite/gfortran.dg/class_51.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/class_51.f90	(Arbeitskopie)
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/52270
+!
+! From IR F08/0073 by Malcolm Cohen
+!
+
+  Program m013
+    Type t
+      Real c
+    End Type
+    Type(t),Target :: x
+    Call sub(x)
+    Print *,x%c
+    if (x%c /= 3) call abort ()
+  Contains
+    Subroutine sub(p)
+      Class(t),Pointer,Intent(In) :: p
+      p%c = 3
+    End Subroutine
+  End Program
+
+! { dg-final { scan-tree-dump-times "sub \\(&class" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
Index: gcc/testsuite/gfortran.dg/class_52.f90
===================================================================
--- gcc/testsuite/gfortran.dg/class_52.f90	(Revision 0)
+++ gcc/testsuite/gfortran.dg/class_52.f90	(Arbeitskopie)
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/52270
+!
+! From IR F08/0073 by Malcolm Cohen
+!
+
+  Program m013
+    Type t
+      Real c
+    End Type
+    Type(t),Target :: x
+    Call sub(x) ! { dg-error "Fortran 2008: Non-pointer actual argument" }
+    Print *,x%c
+    if (x%c /= 3) call abort ()
+  Contains
+    Subroutine sub(p)
+      Class(t),Pointer,Intent(In) :: p
+      p%c = 3
+    End Subroutine
+  End Program
+
