From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ritzert@t-online.de To: gcc-bugs@gcc.gnu.org Cc: austern@apple.com Subject: Is this a bug? Date: Fri, 30 Aug 2002 02:41:00 -0000 Message-id: <1030699963.3d6f3bbb2ea6d@webmail.t-online.de> X-SW-Source: 2002-08/msg00671.html List-Id: 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 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(__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 * 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