Internal compiler error with std::map operations and braces in return statement. - by Petter S

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 808852 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 11/18/2013 4:39:03 AM
Access Restriction Public


The attached .cpp file crashes the compiler when compiling for debug mode.

1>------ Rebuild All started: Project: ConsoleApplication2, Configuration: Debug Win32 ------
1>  scope.cpp
1>c:\users\petter.strandmark\desktop\scope.cpp(14): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 227)
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
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

If the braces in the first return statement are changed to std::make_pair, the error disappears.

Sign in to post a comment.
Posted by Microsoft on 6/5/2014 at 4:39 PM
Hi Petter,

The fix for this bug has been released in Visual Studio 2013 Update 2. Please upgrade and tell us if the problem persists. Thank you.

Karl Niu
Visual C++ Team
Posted by Petter S on 11/25/2013 at 1:18 AM
Does “next major release” include service packs?
Posted by Xiang [MSFT] on 11/24/2013 at 10:17 AM
    Thanks for reporting the issue.
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next major release of Visual C++.
    The following change can workaround the issue:

    std::pair<typename Map::const_iterator,
        typename Map::const_iterator> output;
    if (map.empty()) {
        return{ map.end(), map.end() };


    typedef std::pair<typename Map::const_iterator,
        typename Map::const_iterator> return_type;
    return_type output;
    if (map.empty()) {
        return return_type{map.end(), map.end()};

Xiang Fan
Visual C++ Team
Posted by Microsoft on 11/19/2013 at 12:46 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/18/2013 at 4:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(