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

2007-09-08 Thread bangerth at dealii 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



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

2007-09-07 Thread test dot 007 at seznam dot cz


--- Comment #2 from test dot 007 at seznam dot cz  2007-09-07 07:40 ---
(In reply to comment #1)
I'm ashamed. 
I still believe the code shouldn't compile.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33314



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

2007-09-06 Thread pinskia at gcc dot gnu dot org


--- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-06 20:04 ---
 s1 is surprise

No it is not.

std::cout  s1  std::endl;

Calls s1.operator const char* and not s1.operator .


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33314