This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29188] undocumented extension with ambiguous between conversion function/constructor. related to const
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2006 03:44:53 -0000
- Subject: [Bug c++/29188] undocumented extension with ambiguous between conversion function/constructor. related to const
- References: <bug-29188-13286@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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 ‘A’ to ‘B’ 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