public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR47040 - Make error message for empty array constructor more helpful/correct
@ 2016-04-06 15:45 Dominique d'Humières
  2016-04-07  5:48 ` Steve Kargl
  0 siblings, 1 reply; 11+ messages in thread
From: Dominique d'Humières @ 2016-04-06 15:45 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: fortran, gcc-patches

Is the following patch OK (regtested on x86_64-apple-darwin15)? Should it be back ported to the gcc-5 branch?

TIA

Dominique

Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog	(revision 234788)
+++ gcc/fortran/ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2016-04-06  Tobias Burnus  <burnus@net-b.de>
+	    Dominique d'Humieres <dominiq@lps.ens.fr>
+
+	PR fortran/47040
+	* array.c (gfc_match_array_constructor): add "without type-spec"
+	to the error message.
+
 2016-04-04  Andre Vehreschild  <vehre@gcc.gnu.org>
 
 	PR fortran/67538
Index: gcc/fortran/array.c
===================================================================
--- gcc/fortran/array.c	(revision 234788)
+++ gcc/fortran/array.c	(working copy)
@@ -1136,7 +1136,8 @@
 	goto done;
       else
 	{
-	  gfc_error ("Empty array constructor at %C is not allowed");
+	  gfc_error ("Empty array constructor without type-spec at %C "
+		     "is not allowed");
 	  goto cleanup;
 	}
     }
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 234788)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2016-04-06  Dominique d'Humieres  <dominiq@lps.ens.fr>
+
+	* gfortran.dg/empty_constructor.f90: New test.
+
 2016-04-06  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* gcc.c-torture/execute/20101011-1.c (__VISIUM__): Set DO_TEST to 0.
Index: gcc/testsuite/gfortran.dg/empty_constructor.f90
===================================================================
--- gcc/testsuite/gfortran.dg/empty_constructor.f90	(nonexistent)
+++ gcc/testsuite/gfortran.dg/empty_constructor.f90	(working copy)
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! PR 47040
+! Contributed by Tobias Burnus <burnus@net-b.de>
+!
+program test_print 
+  implicit none
+  integer :: i 
+  call print( [ ] ) ! { dg-error "Empty array constructor without type-spec" }
+  call print( [integer :: ] )
+  call print( pack( [ 1 ], [ 2 ] == 3 ) )
+  call print( [ ( i, i = 1, 0 ) ] )
+contains 
+  subroutine print( array ) 
+    integer, dimension(:) :: array 
+    write(*,*) size(array) 
+  end subroutine print 
+end program test_print 

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

end of thread, other threads:[~2016-04-09 18:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 15:45 [PATCH] PR47040 - Make error message for empty array constructor more helpful/correct Dominique d'Humières
2016-04-07  5:48 ` Steve Kargl
2016-04-07  5:51   ` Dominique d'Humières
2016-04-07 13:59     ` Steve Kargl
2016-04-09 10:28       ` Dominique d'Humières
2016-04-09 15:39         ` Steve Kargl
2016-04-09 15:58           ` Dominique d'Humières
2016-04-09 16:13             ` Steve Kargl
2016-04-09 16:51               ` Dominique d'Humières
2016-04-09 17:03                 ` Steve Kargl
2016-04-09 18:43                   ` [PATCH withdrawn] PR47040 - Make error message for empty array constructor more helpful/correct, closed as INVALID Dominique d'Humières

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).