[Bug c++/9440] [3.4 regression] error message about non-lvalue in unary '' when using ?: operator

2004-11-13 Thread lpadovan at cs dot unibo dot it

--- Additional Comments From lpadovan at cs dot unibo dot it  2004-11-13 
17:52 ---
I'm experiencing a problem with 

  g++-3.4 (GCC) 3.4.2 (Debian 3.4.2-3)

which seems related to this bug, at least because the error message is similar
and the operator ?: is involved. Here is the program that shows the problem:

class V;

template class P
struct S
{
S(P* p) : ptr(p) { }
operator P*() const { return ptr; }
P* ptr;
};

template class P
struct A
{
SV f(const SV x) { return (x ? x : (x ? x : 0)); }
};

and the error is:

a.cc: In member function `SV AP::f(const SV)':
a.cc:14: error: non-lvalue in unary `'
a.cc:14: error: could not convert `x' to `bool'

In

  g++ (GCC) 3.3.5 (Debian 1:3.3.5-2)

the same program is compiled correctly.

Unfortunately I'm unable to test the program with the latest version of the g++
compiler, so please accept my apologies if this has been solved already.


-- 


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


[Bug c++/9440] [3.4 regression] error message about non-lvalue in unary '' when using ?: operator

2004-11-13 Thread reichelt at gcc dot gnu dot org

--- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-13 
18:47 ---
The problem in comment #12 is indeed very similar, but not the same,
since it's not fixed ;-)
I opened PR 18464 to track the new problem.


-- 


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