From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16890 invoked by alias); 12 Sep 2012 11:29:36 -0000 Received: (qmail 16875 invoked by uid 22791); 12 Sep 2012 11:29:34 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KAM_STOCKTIP X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 Sep 2012 11:29:11 +0000 From: "vincenzo.innocente at cern dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/54557] New: [c++ lambda] error in assigning lambda expr though "operator?:" while catching Date: Wed, 12 Sep 2012 11:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vincenzo.innocente at cern dot ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg00927.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54557 Bug #: 54557 Summary: [c++ lambda] error in assigning lambda expr though "operator?:" while catching Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: vincenzo.innocente@cern.ch in this example foo1 and foo2 do not compile, bar and foo3 do. cat iflamda.cc struct A { int q; bool sel; bool bar(int i, int j) const; bool foo1(int i, int j) const; bool foo2(int i, int j) const; bool foo3(int i, int j) const; }; bool A:: bar(int i, int j) const { auto f =3D sel ? [](int a, int b) { return aq;}; return f(i,j); } bool A::foo2(int i, int j) const { int k =3D q; auto f =3D sel ? [k](int a, int b) { return aq;}; ^ iflamda.cc: In member function =E2=80=98bool A::foo2(int, int) const=E2=80= =99: iflamda.cc:33:51: error: no match for ternary =E2=80=98operator?:=E2=80=99 = (operand types are =E2=80=98bool=E2=80=99, =E2=80=98A::foo2(int, int) const::__lambda4=E2=80= =99, and =E2=80=98A::foo2(int, int) const::__lambda5=E2=80=99) [k](int a, int b) { return a