public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault
@ 2015-02-05 15:15 my.pvt.emailaddress at googlemail dot com
  2015-02-09 13:30 ` [Bug c++/64948] " andrea.azzarone at canonical dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: my.pvt.emailaddress at googlemail dot com @ 2015-02-05 15:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64948

            Bug ID: 64948
           Summary: Lambda reference capture initialization in template
                    function creates segmentation fault
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: my.pvt.emailaddress at googlemail dot com

Compilation of the following code leads to the

Error Message
//<<<<<<<<<<<<<<<<<<<<<<<<<//
bug.cc: In function ‘void foo(T)’:
bug.cc:4:20: internal compiler error: Segmentation fault
     [&i = t.cbegin()]() {};
                    ^
//>>>>>>>>>>>>>>>>>>>>>>>>>//

The preprocessed file of a minimal testcase:

bug.ii
//<<<<<<<<<<<<<<<<<<<<<<<<<//
# 1 "bug.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "bug.cc"
template <class T>
void
foo(T t) {
    [&i = t.cbegin()]() {};
}

int main() {
    return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>//

This happens with the

g++ version
//<<<<<<<<<<<<<<<<<<<<<<<<<//
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.9.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /build/gcc/src/gcc-4.9-20141224/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.2 20141224 (prerelease) (GCC)
//>>>>>>>>>>>>>>>>>>>>>>>>>//

and the command
//<<<<<<<<<<<<<<<<<<<<<<<<<//
g++ --std=c++1y bug.cc
//>>>>>>>>>>>>>>>>>>>>>>>>>//

An equivalent(?) code which is perfektly compilable is

nobug.ii
//<<<<<<<<<<<<<<<<<<<<<<<<<//
# 1 "nobug.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "nobug.cc"
template <class T>
void
foo(T t) {
    auto i = t.cbegin();
    [&i]() {};
}

int main() {
    return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>//
>From gcc-bugs-return-476137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 05 15:22:50 2015
Return-Path: <gcc-bugs-return-476137-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1778 invoked by alias); 5 Feb 2015 15:22:49 -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 28706 invoked by uid 48); 5 Feb 2015 15:22:41 -0000
From: "segher at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64580] very high rs6000_stack_info() usage during LTO Firefox build on ppc64
Date: Thu, 05 Feb 2015 15:22:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: segher at gcc dot gnu.org
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-64580-4-0g96LZvBYT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64580-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64580-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: 2015-02/txt/msg00470.txt.bz2
Content-length: 473

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd580

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #15 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Fixed on all open release branches, closing.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/64948] Lambda reference capture initialization in template function creates segmentation fault
  2015-02-05 15:15 [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault my.pvt.emailaddress at googlemail dot com
@ 2015-02-09 13:30 ` andrea.azzarone at canonical dot com
  2015-02-09 15:06 ` andrea.azzarone at canonical dot com
  2015-03-05  8:34 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: andrea.azzarone at canonical dot com @ 2015-02-09 13:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64948

Andrea Azzarone <andrea.azzarone at canonical dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrea.azzarone at canonical dot c
                   |                            |om

--- Comment #1 from Andrea Azzarone <andrea.azzarone at canonical dot com> ---
Created attachment 34705
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34705&action=edit
Proposed fix to allow the use of enable_if for UDLs.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/64948] Lambda reference capture initialization in template function creates segmentation fault
  2015-02-05 15:15 [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault my.pvt.emailaddress at googlemail dot com
  2015-02-09 13:30 ` [Bug c++/64948] " andrea.azzarone at canonical dot com
@ 2015-02-09 15:06 ` andrea.azzarone at canonical dot com
  2015-03-05  8:34 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: andrea.azzarone at canonical dot com @ 2015-02-09 15:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64948

--- Comment #2 from Andrea Azzarone <andrea.azzarone at canonical dot com> ---
(In reply to Andrea Azzarone from comment #1)
> Created attachment 34705 [details]
> Proposed fix to allow the use of enable_if for UDLs.

Sorry this patch was for a different bug report. Please delete it if possible.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/64948] Lambda reference capture initialization in template function creates segmentation fault
  2015-02-05 15:15 [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault my.pvt.emailaddress at googlemail dot com
  2015-02-09 13:30 ` [Bug c++/64948] " andrea.azzarone at canonical dot com
  2015-02-09 15:06 ` andrea.azzarone at canonical dot com
@ 2015-03-05  8:34 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-05  8:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64948

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

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-03-05  8:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 15:15 [Bug c++/64948] New: Lambda reference capture initialization in template function creates segmentation fault my.pvt.emailaddress at googlemail dot com
2015-02-09 13:30 ` [Bug c++/64948] " andrea.azzarone at canonical dot com
2015-02-09 15:06 ` andrea.azzarone at canonical dot com
2015-03-05  8:34 ` paolo.carlini at oracle 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).