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]

[Bug testsuite/37561] [4.4 Regression] Revision 140405 caused g++.old-deja/g++.mike/warn1.C



------- Comment #3 from janis at gcc dot gnu dot org  2008-09-17 17:02 -------
This is twisting my brain, but in this simplified testcase:

  __PTRDIFF_TYPE__ p;
  short q;
  void foo () { ((char *)p)++; }
  void bar () { ((char *)q)++; }

we get an error with both -m32 and-m64 for foo but not for bar:

  elm3b149% /home/janis/tools/gcc-trunk-anonsvn/bin/g++ -c -m32 z.C
  z.C: In function ?void foo()?:
  z.C:3: error: lvalue required as increment operand
  elm3b149% /home/janis/tools/gcc-trunk-anonsvn/bin/g++ -c -m64 z.C
  z.C: In function ?void foo()?:
  z.C:3: error: lvalue required as increment operand

although the expression "(char *)q" in bar is not an lvalue.  What am I
missing?


-- 


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


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