[Bug c++/33314] Ill-formed program compiles without error. Ternary (expr.cond) operands, ambiguous conversion.

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Sat Sep 8 15:20:00 GMT 2007



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



More information about the Gcc-bugs mailing list