public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Problem with procedure pointers
       [not found]             ` <AANLkTi=aR77spzhVm92V4Lx9+W7uvNjn4S__XfLB_XuG@mail.gmail.com>
@ 2011-03-10 19:55               ` Janus Weil
  2011-03-11 13:01                 ` Tobias Burnus
  0 siblings, 1 reply; 3+ messages in thread
From: Janus Weil @ 2011-03-10 19:55 UTC (permalink / raw)
  To: Paul Richard Thomas; +Cc: Tobias Burnus, gfortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

>> While I am inclined to not-bump the version number, I won't mind if you
>> decide to bump it.
>
> I agree.

Ok, since you guys seem to agree on that, here is the patch without
module version bumping, but this time complete with test case and
ChangeLog.

Ok for trunk?

Cheers,
Janus


2011-03-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47768
	* module.c (ab_attribute,attr_bits): Add AB_PROC_POINTER_COMP.
	(mio_symbol_attribute): Handle attribute 'proc_pointer_comp'.

2011-03-10  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47768
	* gfortran.dg/proc_ptr_comp_31.f90: New.

[-- Attachment #2: mod_ppc.diff --]
[-- Type: application/octet-stream, Size: 2055 bytes --]

Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c	(revision 170846)
+++ gcc/fortran/module.c	(working copy)
@@ -1671,8 +1671,9 @@ typedef enum
   AB_POINTER, AB_TARGET, AB_DUMMY, AB_RESULT, AB_DATA,
   AB_IN_NAMELIST, AB_IN_COMMON, AB_FUNCTION, AB_SUBROUTINE, AB_SEQUENCE,
   AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT,
-  AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP,
-  AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
+  AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE,
+  AB_ALLOC_COMP, AB_POINTER_COMP, AB_PROC_POINTER_COMP, AB_PRIVATE_COMP,
+  AB_VALUE, AB_VOLATILE, AB_PROTECTED,
   AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP,
   AB_IS_CLASS, AB_PROCEDURE, AB_PROC_POINTER, AB_ASYNCHRONOUS, AB_CODIMENSION,
   AB_COARRAY_COMP, AB_VTYPE, AB_VTAB, AB_CONTIGUOUS, AB_CLASS_POINTER,
@@ -1716,6 +1717,7 @@ static const mstring attr_bits[] =
     minit ("ALLOC_COMP", AB_ALLOC_COMP),
     minit ("COARRAY_COMP", AB_COARRAY_COMP),
     minit ("POINTER_COMP", AB_POINTER_COMP),
+    minit ("PROC_POINTER_COMP", AB_PROC_POINTER_COMP),
     minit ("PRIVATE_COMP", AB_PRIVATE_COMP),
     minit ("ZERO_COMP", AB_ZERO_COMP),
     minit ("PROTECTED", AB_PROTECTED),
@@ -1881,6 +1883,8 @@ mio_symbol_attribute (symbol_attribute *attr)
 	MIO_NAME (ab_attribute) (AB_ALLOC_COMP, attr_bits);
       if (attr->pointer_comp)
 	MIO_NAME (ab_attribute) (AB_POINTER_COMP, attr_bits);
+      if (attr->proc_pointer_comp)
+	MIO_NAME (ab_attribute) (AB_PROC_POINTER_COMP, attr_bits);
       if (attr->private_comp)
 	MIO_NAME (ab_attribute) (AB_PRIVATE_COMP, attr_bits);
       if (attr->coarray_comp)
@@ -2027,6 +2031,9 @@ mio_symbol_attribute (symbol_attribute *attr)
 	    case AB_POINTER_COMP:
 	      attr->pointer_comp = 1;
 	      break;
+	    case AB_PROC_POINTER_COMP:
+	      attr->proc_pointer_comp = 1;
+	      break;
 	    case AB_PRIVATE_COMP:
 	      attr->private_comp = 1;
 	      break;

[-- Attachment #3: proc_ptr_comp_31.f90 --]
[-- Type: application/octet-stream, Size: 552 bytes --]

! { dg-do compile }
!
! PR 47768: printing a derived-type variable with proc-pointer components
!
! Contributed by Arjen Markus <arjen.markus895@gmail.com>

module proc_pointers
  implicit none
  type :: rectangle
    real :: width, height
    procedure(real), pointer, nopass :: get_special_area
  end type
end module

program test_objects
  use proc_pointers
  implicit none
  type(rectangle) :: rect
  write(*,*) rect          ! { dg-error "cannot have procedure pointer components" }
end program

! { dg-final { cleanup-modules "proc_pointers" } }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with procedure pointers
  2011-03-10 19:55               ` Problem with procedure pointers Janus Weil
@ 2011-03-11 13:01                 ` Tobias Burnus
  2011-03-11 14:15                   ` Janus Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Burnus @ 2011-03-11 13:01 UTC (permalink / raw)
  To: Janus Weil; +Cc: Paul Richard Thomas, gfortran, gcc-patches

On 03/10/2011 08:55 PM, Janus Weil wrote:
> Ok, since you guys seem to agree on that, here is the patch without 
> module version bumping, but this time complete with test case and 
> ChangeLog.
> Ok for trunk?

OK. Thanks for the patch.

Tobias

> 2011-03-10  Janus Weil<janus@gcc.gnu.org>
>
> 	PR fortran/47768
> 	* module.c (ab_attribute,attr_bits): Add AB_PROC_POINTER_COMP.
> 	(mio_symbol_attribute): Handle attribute 'proc_pointer_comp'.
>
> 2011-03-10  Janus Weil<janus@gcc.gnu.org>
>
> 	PR fortran/47768
> 	* gfortran.dg/proc_ptr_comp_31.f90: New.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem with procedure pointers
  2011-03-11 13:01                 ` Tobias Burnus
@ 2011-03-11 14:15                   ` Janus Weil
  0 siblings, 0 replies; 3+ messages in thread
From: Janus Weil @ 2011-03-11 14:15 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: Paul Richard Thomas, gfortran, gcc-patches

>> Ok, since you guys seem to agree on that, here is the patch without module
>> version bumping, but this time complete with test case and ChangeLog.
>> Ok for trunk?
>
> OK. Thanks for the patch.

Thanks. Committed as r170871.

Cheers,
Janus



>> 2011-03-10  Janus Weil<janus@gcc.gnu.org>
>>
>>        PR fortran/47768
>>        * module.c (ab_attribute,attr_bits): Add AB_PROC_POINTER_COMP.
>>        (mio_symbol_attribute): Handle attribute 'proc_pointer_comp'.
>>
>> 2011-03-10  Janus Weil<janus@gcc.gnu.org>
>>
>>        PR fortran/47768
>>        * gfortran.dg/proc_ptr_comp_31.f90: New.
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-11 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AANLkTin1UzR57_DvVyo7YbBc-A87HV6p5OK0LHjJvgGT@mail.gmail.com>
     [not found] ` <AANLkTi=SQQaa9nOqYrsRbcwmBEGXyWX_Fwm4LOOuBo2c@mail.gmail.com>
     [not found]   ` <AANLkTikBb6EK-32zV2HF4WB27vmz8udxOCJJNWeoQDAg@mail.gmail.com>
     [not found]     ` <AANLkTikmnH-cXcFqtBqBTWsqoVrwB01EAyakHY8KEx_Q@mail.gmail.com>
     [not found]       ` <AANLkTimAKBr0w0axcW2vkFmKDwZAMHjhYzwiYsy-bKMa@mail.gmail.com>
     [not found]         ` <AANLkTikVUiwasoM-Bcyco=udJKFJoPTONrqdVH_5ZEFP@mail.gmail.com>
     [not found]           ` <4D78EB75.5000605@net-b.de>
     [not found]             ` <AANLkTi=aR77spzhVm92V4Lx9+W7uvNjn4S__XfLB_XuG@mail.gmail.com>
2011-03-10 19:55               ` Problem with procedure pointers Janus Weil
2011-03-11 13:01                 ` Tobias Burnus
2011-03-11 14:15                   ` Janus Weil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).