public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/9440] [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator
       [not found] <20030125175600.9440.andrew@andypo.net>
@ 2004-11-13 17:52 ` lpadovan at cs dot unibo dot it
  2004-11-13 18:47 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 2+ messages in thread
From: lpadovan at cs dot unibo dot it @ 2004-11-13 17:52 UTC (permalink / raw)
  To: gcc-bugs


------- 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
{
        S<V> f(const S<V>& x) { return (x ? x : (x ? x : 0)); }
};

and the error is:

a.cc: In member function `S<V> A<P>::f(const S<V>&)':
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/9440] [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator
       [not found] <20030125175600.9440.andrew@andypo.net>
  2004-11-13 17:52 ` [Bug c++/9440] [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator lpadovan at cs dot unibo dot it
@ 2004-11-13 18:47 ` reichelt at gcc dot gnu dot org
  1 sibling, 0 replies; 2+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-13 18:47 UTC (permalink / raw)
  To: gcc-bugs


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-13 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20030125175600.9440.andrew@andypo.net>
2004-11-13 17:52 ` [Bug c++/9440] [3.4 regression] error message about "non-lvalue in unary '&'" when using ?: operator lpadovan at cs dot unibo dot it
2004-11-13 18:47 ` reichelt at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).