public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:"
@ 2010-11-04  9:17 burnus at gcc dot gnu.org
  2010-11-04  9:20 ` [Bug fortran/46301] " burnus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-11-04  9:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

           Summary: [4.6 Regression] Missing diagnosis for "len=:"
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Found in PR 35810. The following program is accepted without any error for the
"len=:".

While the program is valid Fortran 2003, without trans*.c implementation for
allocatable string lengths (cf. PR 45170), it should be rejected.

   program tst
      character(len=:), allocatable :: S
      S='abcdef'
      S=S(3:)
      write(*,'("|",A,"|")')S
   end program tst


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
@ 2010-11-04  9:20 ` burnus at gcc dot gnu.org
  2010-11-04 15:08 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-11-04  9:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-04 09:19:59 UTC ---
(The 'regression' is due to PR 45170 comment 5, which added the parsing support
for "len=:".)


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
  2010-11-04  9:20 ` [Bug fortran/46301] " burnus at gcc dot gnu.org
@ 2010-11-04 15:08 ` rguenth at gcc dot gnu.org
  2010-11-04 17:48 ` kargl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-04 15:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
  2010-11-04  9:20 ` [Bug fortran/46301] " burnus at gcc dot gnu.org
  2010-11-04 15:08 ` rguenth at gcc dot gnu.org
@ 2010-11-04 17:48 ` kargl at gcc dot gnu.org
  2010-11-04 18:00 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2010-11-04 17:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org 2010-11-04 17:47:49 UTC ---
Index: resolve.c
===================================================================
--- resolve.c   (revision 166318)
+++ resolve.c   (working copy)
@@ -11739,6 +11739,15 @@ resolve_symbol (gfc_symbol *sym)
   gfc_namespace *ns;
   gfc_component *c;

+  /* FIXME: Until deferred type parameters are resolved and translated to
+     to something useful, just bail out. */
+  if (sym->ts.type == BT_CHARACTER && sym->ts.deferred)
+    {
+      gfc_error ("Deferred type parameter at %L is unsupported",
+                &sym->declared_at);
+      return;
+    }
+
   /* Avoid double resolution of function result symbols.  */
   if ((sym->result || sym->attr.result) && !sym->attr.dummy
       && (sym->ns != gfc_current_ns))


troutmask:sgk[232] gfc4x -o z g.f90
g.f90:2.40:

      character(len=:), allocatable :: S
                                        1
Error: Deferred type parameter at (1) is unsupported

Also note that the testcase fails to compile if
one asks for Fortran conformance with or without this 
patch. 

troutmask:sgk[233] gfc4x -o z -std=f95 g.f90
g.f90:2.21:

      character(len=:), allocatable :: S
                     1
Error: Fortran 2003: deferred type parameter at (1)
g.f90:4.6:

      S=S(3:)
      1
Error: Unclassifiable statement at (1)
g.f90:3.8:

      S='abcdef'
        1
Error: Can't convert CHARACTER(1) to REAL(4) at (1)


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-11-04 17:48 ` kargl at gcc dot gnu.org
@ 2010-11-04 18:00 ` burnus at gcc dot gnu.org
  2010-11-27 22:57 ` jvdelisle at gcc dot gnu.org
  2010-11-27 23:18 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-11-04 18:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-04 18:00:07 UTC ---
Created attachment 22285
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22285
Draft patch

The following fails - but for the wrong reason (regarded as "len=*").

Error: Character length of component 's' needs to be a constant specification
expression at (1)

   subroutine test
      type t
        character(len=:), allocatable :: S
      end type t
      type(t) :: x
      x%S='abcdef'
   end subroutine


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2010-11-04 18:00 ` burnus at gcc dot gnu.org
@ 2010-11-27 22:57 ` jvdelisle at gcc dot gnu.org
  2010-11-27 23:18 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2010-11-27 22:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-11-27 22:12:49 UTC ---
Author: jvdelisle
Date: Sat Nov 27 22:12:46 2010
New Revision: 167212

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167212
Log:
2010-11-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

    PR fortran/46301
    trans-expr.c (gfc_trans_assignment): Add error message for not
    implemented assignment to deferred-length character variable.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-expr.c


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

* [Bug fortran/46301] [4.6 Regression] Missing diagnosis for "len=:"
  2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2010-11-27 22:57 ` jvdelisle at gcc dot gnu.org
@ 2010-11-27 23:18 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2010-11-27 23:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46301

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jvdelisle at gcc dot
                   |                            |gnu.org
         Resolution|                            |FIXED

--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-11-27 22:32:10 UTC ---
Closing


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

end of thread, other threads:[~2010-11-27 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04  9:17 [Bug fortran/46301] New: [4.6 Regression] Missing diagnosis for "len=:" burnus at gcc dot gnu.org
2010-11-04  9:20 ` [Bug fortran/46301] " burnus at gcc dot gnu.org
2010-11-04 15:08 ` rguenth at gcc dot gnu.org
2010-11-04 17:48 ` kargl at gcc dot gnu.org
2010-11-04 18:00 ` burnus at gcc dot gnu.org
2010-11-27 22:57 ` jvdelisle at gcc dot gnu.org
2010-11-27 23:18 ` jvdelisle at gcc dot gnu.org

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