Search

internal compiler error by Jason Smestad

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 739900
Opened: 4/30/2012 8:55:50 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
1
User(s) can reproduce this bug
When using precompiled headers and debug options, a particular construct causes the compiler to produce "fatal error C1001: An internal error has occurred in the compiler."
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

1. Create an empty project in Visual Studio 2010 SP1
2. Add a new file stdafx.h with the following contents:

template<class x> class test_template {
    public:    virtual ~test_template(){}
};

test_template<void> test;

3. Add a new file test.cpp with the following contents:

#include "stdafx.h"
class __declspec(dllimport) testclass : public test_template<void> {};

4. In the project properties, navigate to
Configuration Properties -> C/C++ -> Precompiled Headers

Change the "Precompiled Header" option to "Create (/Yc)" and press "Ok"

5. Open "test.cpp" and press Control+F7 to compile it. Observe the output.

Product Language

English

Operating System

Windows XP

Operating System Language

English

Actual results

1>------ Build started: Project: compiler_test, Configuration: Debug Win32 ------
1>Build started 4/30/2012 9:28:49 AM.
1>ClCompile:
1> test.cpp
1>C:\projects\compiler_test\test.cpp : fatal error C1001: An internal error has occurred in the compiler.
1> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\p2symtab.c', line 6172)
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:00.74
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Expected results

1>------ Build started: Project: compiler_test, Configuration: Debug Win32 ------
1>Build started 4/30/2012 9:28:49 AM.
1>ClCompile:
1> test.cpp
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.68
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
File Attachments
File Name Submitted By Submitted On File Size  
compiler_test.zip 4/30/2012 5 KB
Sign in to post a comment.
Posted by Jason Smestad on 5/2/2012 at 6:14 PM
If you set the "Whole Program Optimization" option to "Use Link Time Code Generation" (/GL) the file compiles successfully, but if you turn it off the error occurs.
Posted by Microsoft on 5/2/2012 at 5:44 PM
Hello Jason,

Thank you for reporting this issue. We're aware of this bug in our compiler. We have fixed this in the current VC++ compiler that will be available soon publicly in the next major release of Visual Studio.

Thanks,
Ulzii Luvsanbat
Visual C++ Team
Posted by MS-Moderator07 [Feedback Moderator] on 4/30/2012 at 7:15 PM
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 MS-Moderator01 on 4/30/2012 at 9:43 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.