following example file can't compiled $ cat bug.cpp class A{ public: bool operator()() const { return true; } };
int main() { if ((A()())) {} } $ g++-4.1 -c bug.cpp bug.cpp: In function int main(): bug.cpp:9: error: type name declared as function returning a function bug.cpp:9: error: type name declared as function returning a function $ g++-4.1 --version g++-4.1 (GCC) 4.1.2 20061212 (prerelease) (Ubuntu 4.1.1-21ubuntu3) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- Summary: compile error when meet with ((A()())) Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lidaobing at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30725