public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "damian at sourceryinstitute dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/97864] Homebrew Operator Overload ICE
Date: Thu, 19 Nov 2020 19:42:28 +0000	[thread overview]
Message-ID: <bug-97864-4-1oTkNFJDWE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97864-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97864

Damian Rouson <damian at sourceryinstitute dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |damian at sourceryinstitute dot or
                   |                            |g

--- Comment #3 from Damian Rouson <damian at sourceryinstitute dot org> ---
Here's a reduced version of the original code, still causing an ICE:

    implicit none

    type VARYING_STRING
        character(len=1), allocatable :: characters(:)
    end type

    interface operator(==)
        procedure character_EQ_String
    end interface

    print *, stringToChar(var_str("Hello")) == var_str("World") ! causes ice

contains
    logical function character_EQ_String(lhs, rhs)
        character(len=*), intent(in) :: lhs
        type(VARYING_STRING), intent(in) :: rhs
        character_EQ_String = lhs == stringToChar(rhs)
    end function

    function stringToChar(string)
        type(VARYING_STRING) string
        character(len=size(string%characters)) :: stringToChar
        stringToChar = ""
    end function

    type(VARYING_STRING) function VAR_STR(char)
        character(len=*) char
        integer i
        VAR_STR%characters = [(char(i:i), i = 1, len(char))]
    end function
end

  parent reply	other threads:[~2020-11-19 19:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 20:33 [Bug fortran/97864] New: " everythingfunctional at protonmail dot com
2020-11-16 23:02 ` [Bug fortran/97864] " dominiq at lps dot ens.fr
2020-11-17  5:57 ` everythingfunctional at protonmail dot com
2020-11-19 19:42 ` damian at sourceryinstitute dot org [this message]
2020-11-19 20:27 ` damian at sourceryinstitute dot org
2020-11-19 20:36 ` iains at gcc dot gnu.org
2020-11-19 20:49 ` everythingfunctional at protonmail dot com
2020-11-25 17:09 ` iains at gcc dot gnu.org
2020-11-25 20:05 ` everythingfunctional at protonmail dot com
2020-11-25 20:11 ` iains at gcc dot gnu.org
2020-11-25 20:26 ` fxcoudert at gcc dot gnu.org
2020-11-25 20:31 ` iains at gcc dot gnu.org
2020-11-25 20:35 ` fxcoudert at gcc dot gnu.org
2020-11-25 20:37 ` fxcoudert at gcc dot gnu.org
2020-11-25 20:43 ` iains at gcc dot gnu.org
2020-11-25 20:45 ` fxcoudert at gcc dot gnu.org
2020-11-26  1:09 ` iains at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97864-4-1oTkNFJDWE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).