This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33314] Ill-formed program compiles without error. Ternary (expr.cond) operands, ambiguous conversion.
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Sep 2007 15:20:42 -0000
- Subject: [Bug c++/33314] Ill-formed program compiles without error. Ternary (expr.cond) operands, ambiguous conversion.
- References: <bug-33314-11762@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from bangerth at dealii dot org 2007-09-08 15:20 -------
You omit the part of the section that talks about lvalues and rvalues. That
part clarifies which of the conversions is to be taken here.
If you really want to make your program ambiguous do this:
---------------
const char *p="";
MyString s1 = (isEmpty) ? p : s0;
---------------
Now the first argument is an lvalue and the conversions become ambiguous.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33314