public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrey Pozdeev <AndreyPozdeev@rambler.ru>
To: gcc-help@gcc.gnu.org
Subject: Problem with overloaded function selection
Date: Mon, 12 Aug 2002 03:18:00 -0000	[thread overview]
Message-ID: <3D578A3C.AA20189@mb1.rambler.ru> (raw)

I tried to compile the following example using GCC and MS Visual C++:
-----------
class A
{
    public:
    A(){};
};

class B
{
    public:
    operator double() {return 0L;};
    operator int() { return 0; };
    operator A() { return A();};
};


void test(char){};
void test(A){};

int main()
{
  B b;
  test(b);
  return 0;
}
-------------
Both compilers compiles this example succesfully.
But if we comment line with 'operator double' or with 'operator int' then GCC 
will complain, Visual C++ will not.

What's the matter ?

Andrey.
----
  http://www.rambler.ru

             reply	other threads:[~2002-08-12 10:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-12  3:18 Andrey Pozdeev [this message]
2002-08-12  3:22 Andrey Pozdeev
2002-08-12  3:25 Andrey Pozdeev
2002-08-12  7:01 ` bjorn rohde jensen
     [not found] <616BE6A276E3714788D2AC35C40CD18D780D92@whale.softwire.co.uk>
2002-08-12  7:07 ` Rupert Wood
2002-08-12  7:13   ` bjorn rohde jensen

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=3D578A3C.AA20189@mb1.rambler.ru \
    --to=andreypozdeev@rambler.ru \
    --cc=gcc-help@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).