public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ben_ship at lycos dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/30877] overloading  "operator(*)"  for intrinsic type (complex) fails
Date: Thu, 22 Feb 2007 03:16:00 -0000	[thread overview]
Message-ID: <20070222031613.16766.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30877-6642@http.gcc.gnu.org/bugzilla/>



------- Comment #4 from ben_ship at lycos dot com  2007-02-22 03:16 -------
This might actually be a more general issue with operator overloading.

In this example the overloading of an operator that works on two different
shaped operands of intrinsic types is not allowed. At the same time 
there is no know conflicting operator (*) for generating the product 
"a*b" and you cannot define one without either

- changing "COMPLEX" to some derived type with complex elements, 
  therefore removing the type issue.

- replacing "*" with some user defined operator, e.g.".times.", rather than
overloading. (but then precedence is an issue)

I think it is a little unusual that COMPLEX is used rather than some derived
type.  However, ifort and g95 will compile this code.


-- 


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


  parent reply	other threads:[~2007-02-22  3:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-20  7:52 [Bug fortran/30877] New: incorrect error message for valid code jv244 at cam dot ac dot uk
2007-02-20 16:32 ` [Bug fortran/30877] overloading "operator(*)" for intrinsic type (complex) fails burnus at gcc dot gnu dot org
2007-02-21 21:15 ` pault at gcc dot gnu dot org
2007-02-22  1:35 ` ben_ship at lycos dot com
2007-02-22  3:16 ` ben_ship at lycos dot com [this message]
2007-03-21  0:10 ` fxcoudert at gcc dot gnu dot org
2007-03-21 14:02 ` [Bug fortran/30877] Extending intrinsic operators fxcoudert at gcc dot gnu dot org
2007-03-21 14:50 ` fxcoudert at gcc dot gnu dot org
2007-03-25  9:01 ` fxcoudert at gcc dot gnu dot org
2007-03-25  9:02 ` fxcoudert at gcc dot gnu dot 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=20070222031613.16766.qmail@sourceware.org \
    --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).