re PR fortran/58471 (ICE on invalid with missing type constructor and -Wall)

2013-11-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58471
	* primary.c (gfc_expr_attr): Check for result symbol.

2013-11-07  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58471
	* gfortran.dg/constructor_9.f90: New.

From-SVN: r204547
This commit is contained in:
Janus Weil 2013-11-07 23:39:15 +01:00
parent 9de84e84f2
commit 50c7654b96
4 changed files with 33 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-11-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/58471
* primary.c (gfc_expr_attr): Check for result symbol.
2013-11-06 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* gfortran.texi: Fix typo.

View File

@ -2258,7 +2258,7 @@ gfc_expr_attr (gfc_expr *e)
case EXPR_FUNCTION:
gfc_clear_attr (&attr);
if (e->value.function.esym != NULL)
if (e->value.function.esym && e->value.function.esym->result)
{
gfc_symbol *sym = e->value.function.esym->result;
attr = sym->attr;

View File

@ -1,3 +1,8 @@
2013-11-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/58471
* gfortran.dg/constructor_9.f90: New.
2013-11-07 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/atomic-compare-exchange-1.c,

View File

@ -0,0 +1,22 @@
! { dg-do compile }
! { dg-options "-Wall" }
!
! PR 58471: [4.8/4.9 Regression] ICE on invalid with missing type constructor and -Wall
!
! Contributed by Andrew Benson <abensonca@gmail.com>
module cf
implicit none
type :: cfmde
end type
interface cfmde
module procedure mdedc ! { dg-error "is neither function nor subroutine" }
end interface
contains
subroutine cfi()
type(cfmde), pointer :: cfd
cfd=cfmde() ! { dg-error "Can't convert" }
end subroutine
end module
! { dg-final { cleanup-modules "cf" } }