Home Dashboard Directory Help
Search

Compiler crash on C++ code by hoopoepg


Status: 

Closed
 as Fixed Help for as Fixed


2
0
Sign in
to vote
Type: Bug
ID: 759048
Opened: 8/22/2012 3:03:06 AM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

this C++ code crashes compiler:
// *****************************************
int _tmain(int argc, _TCHAR* argv[])
{
    typedef struct my_struct
    {
        int a;
    } my_struct;

    auto l = []()->bool{ my_struct a; return true; };

    return 0;
}
// ****************************************

during compilation error reported:

**********************************
1>------ Build started: Project: lambda_test, Configuration: Debug Win32 ------
1>Build started 22.08.2012 13:53:18.
1>InitializeBuildStatus:
1> Touching "Debug\lambda_test.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1> lambda_test.cpp
1>lambda_test.cpp(14): fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'msc1.cpp', line 1420)
1> To work around this problem, try simplifying or changing the program near the locations listed above.
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:07.22
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
**********************************

thank you

--Sergey
Details
Sign in to post a comment.
Posted by Microsoft on 8/23/2012 at 11:06 AM
Hi hoopoegp:
    Thanks for reporting the issue.
    The issue has been fixed in Visual C++ 2012.

Xiang Fan
Visual C++ Team
Posted by hoopoepg on 8/22/2012 at 11:35 PM
oh... i see...
i tested this code on VS2012 (RC) - it works fine

thank you

--Sergey
Posted by Microsoft on 8/22/2012 at 11:10 PM
The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx
Posted by hoopoepg on 8/22/2012 at 4:04 AM
hi

thank you for feedback

there is a mistake in issue description: issue happened on VS2010 (not tested on 2012 yet)

sorry...

thank you again

--Sergey
Posted by Microsoft on 8/22/2012 at 3:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by hoopoepg on 8/22/2012 at 3:05 AM
the simplest workaround is: move structure declaration out of function body... but then could be issues in naming conflicts...