From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24423 invoked by alias); 10 Oct 2006 03:51:52 -0000 Received: (qmail 24398 invoked by uid 48); 10 Oct 2006 03:51:44 -0000 Date: Tue, 10 Oct 2006 03:51:00 -0000 Message-ID: <20061010035144.24397.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/29234] Call to operator() of temporary object wrongly parsed In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "bangerth at dealii dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-10/txt/msg00752.txt.bz2 List-Id: ------- Comment #1 from bangerth at dealii dot org 2006-10-10 03:51 ------- Confirmed: ------------------ struct S { void operator () (); }; void foo () { ( S()() ); } ------------------ g/x> /home/bangerth/bin/gcc-4.2-pre/bin/c++ -c x.cc x.cc: In function ‘void foo()’: x.cc:5: error: ‘type name’ declared as function returning a function x.cc:5: error: ‘type name’ declared as function returning a function The error message also isn't particularly enlightening, and is duplicated on top of that. I think what is happening is that we parse the expression as the beginning of a C-style cast to type S (*) () but when we don't find an argument for the cast, we should backtrack. W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at dealii dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |rejects-valid Priority|P3 |P2 Last reconfirmed|0000-00-00 00:00:00 |2006-10-10 03:51:44 date| | Summary|Cannot put temporary member |Call to operator() of |functor calls inside |temporary object wrongly |brackets |parsed http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234