This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12522] New: Correct code with operator, fails to compile
- From: "atlaste at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2003 11:58:22 -0000
- Subject: [Bug c++/12522] New: Correct code with operator, fails to compile
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.