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 c++/28918] New: [4.2 regression] rejects minimum/maximum operator in some c++ code


We're now rejecting the minimum/maximum operator in some c++ code.
This is a new regression.  It works with 20060806.

(sid)106:tbm@usurper: ~] /usr/lib/gcc-snapshot/bin/g++ -c orig.c
orig.c: In member function 'virtual void IBox::Rebuild()':
orig.c:10: error: expected primary-expression before '?' token
orig.c:10: error: expected `:' before ')' token
orig.c:10: error: expected primary-expression before ')' token
zsh: exit 1     /usr/lib/gcc-snapshot/bin/g++ -c orig.c
(sid)107:tbm@usurper: ~] g++-4.1 -c orig.c
orig.c: In member function ?virtual void IBox::Rebuild()?:
orig.c:10: warning: minimum/maximum operators are deprecated
(sid)108:tbm@usurper: ~]

Testcase:

extern int XCopyArea (unsigned int);
class IBox
{
  virtual void Rebuild ();
  int Wlen, xsize;
};
void
IBox::Rebuild ()
{
  XCopyArea(Wlen<?(xsize - 4));
}


-- 
           Summary: [4.2 regression] rejects minimum/maximum operator in
                    some c++ code
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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