Home Dashboard Directory Help

Compiler crash on C++ code by hoopoepg


 as Fixed Help for as Fixed

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


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> Touching "Debug\lambda_test.unsuccessfulbuild".
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>Build FAILED.
1>Time Elapsed 00:00:07.22
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

thank you

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

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:
Posted by hoopoepg on 8/22/2012 at 4:04 AM

thank you for feedback

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


thank you again

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...