Search

C++ compiler crashes instead of returning error for simple erroneous C++ code by 666KoD666

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 753699
Opened: 7/14/2012 2:08:28 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
C++ code (which contains small error) causes C++ compiler to crash:

template <typename _retType>
    void Function(_retType (*func)(...))
{
}

int main()
{
    Function<void>(&Function);

    return 0;
}
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling Version

Visual Studio 2012 RC

Steps to reproduce

1. Create empty VC++ project ("Win32 Console Application").
2. In the project, create new .cpp file with following content:

template <typename _retType>
    void Function(_retType (*func)(...))
{
}

int main()
{
    Function<void>(&Function);

    return 0;
}

3. Build / compile created project.

Product Language

English

Operating System

Windows Server 2008 R2

Operating System Language

English

Actual results

C++ compiler crashes: "error C1001: An internal error occurred in the compiler."

Expected results

C++ compilator fails to compile (without crashing) and returns appropriate error, e.g. the same as IntelliSense returns.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 11/19/2012 at 2:49 PM
Hi:
    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 release of Visual C++.
Posted by Microsoft on 7/16/2012 at 12:11 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 7/15/2012 at 7:39 PM
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.