public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57995] New: [4.72, C++11] Lambda [&] wrongly states catch(...) must be the last handler when variable by-reference capture occurs within catch(...) scope
@ 2013-07-26 16:04 devcontrib4590 at gmail dot com
  0 siblings, 0 replies; only message in thread
From: devcontrib4590 at gmail dot com @ 2013-07-26 16:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57995

            Bug ID: 57995
           Summary: [4.72, C++11] Lambda [&] wrongly states catch(...)
                    must be the last handler when variable by-reference
                    capture occurs within catch(...) scope
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: devcontrib4590 at gmail dot com

Created attachment 30559
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30559&action=edit
Example Code that shows 2 failures and 2 passing cases.

The following code snippet (see attachment for full code), produces the error,
"error: ‘...’ handler must be the last handler for its try block
[-fpermissive]", but explict capture of the variable rv, or usage of rv outside
of the catch(...) scope.


// $ g++ --version
// g++ (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
// Copyright (C) 2012 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.
//
// $ cat /etc/redhat-release 
// Fedora release 18 (Spherical Cow)
//
// $ uname -a
// Linux redacted 3.9.11-200.fc18.x86_64 #1 SMP Mon Jul 22 21:04:50 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux

    bool rv;

    auto broken = [&] () 
    {
        try
        {

        }
        catch(...)
        {
            // Capturing a variable here produces an error related to exception
handling
            rv=false;
        }
    };
>From gcc-bugs-return-426780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 26 16:25:51 2013
Return-Path: <gcc-bugs-return-426780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11907 invoked by alias); 26 Jul 2013 16:25:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11762 invoked by uid 48); 26 Jul 2013 16:25:47 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57995] [4.72, C++11] Lambda [&] wrongly states catch(...) must be the last handler when variable by-reference capture occurs within catch(...) scope
Date: Fri, 26 Jul 2013 16:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.7.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-57995-4-o35kp91F3a@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57995-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57995-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-07/txt/msg01287.txt.bz2
Content-length: 509

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW995

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Already fixed.

*** This bug has been marked as a duplicate of bug 56388 ***


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-26 16:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 16:04 [Bug c++/57995] New: [4.72, C++11] Lambda [&] wrongly states catch(...) must be the last handler when variable by-reference capture occurs within catch(...) scope devcontrib4590 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).