This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/29188] undocumented extension with ambiguous between conversion function/constructor. related to const



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]