From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt) Description of problem: g++ does not like extra parenthesis in cast expression like (A)(B()). It compiles this expression (A)B() though. A and B are two user defined types. Version-Release number of selected component (if applicable): gcc 2.96 How reproducible: Always Steps to Reproduce: 1.Write a file test.cpp with contenct as follows... ///////////////start of test case////////////////// class B{}; class A{ public: operator B(){ return B(); } }; void foo(B b) {} void foobar() { foo ( (B) A() ); foo ( (B)(A()) ); //does not compile in g++ } /////////////end of test case/////////// 2.compile using g++ v2.96 as follows... g++ -c - 3. Actual Results: test.cpp: In function `void foobar ()': test.cpp:11: parse error before `)' Expected Results: It should have compiled without any errors. Additional info: It compiles with Sun CC5.0, HP aCC3.30 without errors.
True in 3.2 but I'm not sure its a C++ bug
Fixed with gcc 3.4 c++ parser rewrite.