Bug 52014 - [c++0x] Segfault When `decltype` Used in Nested Lambda Function Defined in Class Member Function
Summary: [c++0x] Segfault When `decltype` Used in Nested Lambda Function Defined in Cl...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.1
: P3 normal
Target Milestone: 4.8.1
Assignee: Jason Merrill
URL:
Keywords: c++-lambda
Depends on:
Blocks: lambdas
  Show dependency treegraph
 
Reported: 2012-01-27 07:00 UTC by cheesear
Modified: 2022-03-11 00:32 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.7.0, 4.8.0
Last reconfirmed: 2012-06-11 00:00:00


Attachments
File containing code sample with offending bug. (332 bytes, text/x-c++src)
2012-01-27 07:00 UTC, cheesear
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cheesear 2012-01-27 07:00:51 UTC
Created attachment 26475 [details]
File containing code sample with offending bug.

Hello everyone,

When I try to compile the attached C++ file using the following command, g++ undergoes an internal segmentation fault.

$ g++ -Wall -std=c++0x nested_lambda.cpp
nested_lambda.cpp: In lambda function:
nested_lambda.cpp:42:56: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccqYohFA.out file, please attach this to your bugreport.

I'm using g++ version 4.6.1, running on Linux Mint 12 64-bit, obtained from the Ubuntu repository.
Comment 1 cheesear 2012-01-27 07:05:26 UTC
Sorry, accidentally hit return before I was ready. The code sample fails to compile because of the use of decltype in the parameter-list of the nested lambda function defined in bar.test(). Using a typedef in advance will circumvent this issue.
Comment 2 Jonathan Wakely 2012-06-11 14:45:39 UTC
Confirmed.

Is helper::type supposed to be public?
Comment 3 Jason Merrill 2013-03-25 20:39:30 UTC
Fixed for 4.8.1.