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]

Is this a bug?


Hi all,

Since 2002-08-26 I'm unable to compile STLPort with gcc HEAD. I have
stripped down the STLPort code to this small testcase:

# cat x.cpp
template <class _Tp>
inline const _Tp& max(const _Tp& __a, const _Tp& __b)
        { return __a < __b ? __b : __a; }

void append()
{
        const unsigned __old_size = 3;
        int __n = 7;
        max(__old_size, static_cast<unsigned>(__n));
}

# gcc -c x.cpp
x.cpp: In function `void append()':
x.cpp:9: error: non-lvalue in unary `&'

The patch causing this seems to be
2002-08-24  Matt Austern  <austern@apple.com>

	* tree.c (lvalue_p_1): Add argument for whether casts of lvalues
	are allowable.
	(real_lvalue_p): Update caller.
	(lvalue_p): Ditto.
	(non_cast_lvalue_or_else): New.
	* tree.h: Declare it.
	* typeck.c (build_unary_op): Use non_cast_lvalue_or_else.

The ChangeLog to the previous successful build is rather small with
this being the only patch that looks suspicious to me.

If this is considered a bug, just tell me and I'll file a bug report
for it. (Or fix it before I get the chance to do so ;-) ).

Regards,
Michael


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