public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/29188] undocumented extension with ambiguous between conversion function/constructor. related to const
Date: Tue, 10 Oct 2006 03:45:00 -0000	[thread overview]
Message-ID: <20061010034453.22862.qmail@sourceware.org> (raw)
In-Reply-To: <bug-29188-13286@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from bangerth at dealii dot org  2006-10-10 03:44 -------
Confirmed. Not a useful extension because confusing:
-----------------
struct A;

struct B {
    B (const A&);
};

struct A {
    operator B() const;
};

A a;
B b1 =  a;    // xpass
-----------------------
g/x> /home/bangerth/bin/gcc-4.2-pre/bin/c++ -c x.cc
g/x> /home/bangerth/bin/gcc-4.2-pre/bin/c++ -c x.cc -pedantic
x.cc:12: error: conversion from &#8216;A&#8217; to &#8216;B&#8217; is ambiguous
x.cc:8: note: candidates are: A::operator B() const
x.cc:4: note:                 B::B(const A&)


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-10 03:44:52
               date|                            |


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


      parent reply	other threads:[~2006-10-10  3:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-22 23:46 [Bug c++/29188] New: accepts-invalid " greifel at megatop200 dot com
2006-09-22 23:58 ` [Bug c++/29188] undocumented extension with " pinskia at gcc dot gnu dot org
2006-09-23 16:29 ` greifel at megatop200 dot com
2006-10-10  3:45 ` bangerth at dealii dot org [this message]

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