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++/33314] Ill-formed program compiles without error. Ternary (expr.cond) operands, ambiguous conversion.



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


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