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++/12522] New: Correct code with operator, fails to compile


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Correct code with operator, fails to compile
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: atlaste at yahoo dot com
                CC: gcc-bugs at gcc dot gnu dot org

The following snippet fails to compile with the g++ compiler (tested versions 
2.95.4, 3.0.4, 3.2.3, 3.3.2):

---
struct bla {
        bla &operator,(int) { return *this; }
};

int main() {
        (bla(),5);
        return 0;
}
---

However, if we replace the "(bla(),5)" with "bla(),5", the code compiles 
correctly.


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