Search

An internal compiler error reduced to a small code snippet by Kaba_

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 735254
Opened: 4/3/2012 8:40:40 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
0
User(s) can reproduce this bug
Visual Studio crashes with an internal compiler error when given this small code snippet. This code was manually reduced from real library code by expanding includes and doing a binary search on reduced code snippets.
Details (expand)

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

Visual Studio 2010 SP1

Steps to reproduce

template<typename N>
class A;

template <int N>
class B    {};

template <int N>
void f()
{
    auto h = [&]()
    {
        B<N> b;
    };
}

int main()
{
    f<2>();
    return 0;
}

Product Language

English

Operating System

Windows XP

Operating System Language

English

Actual results

Internal compiler error.

Expected results

Compiles.
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 4/5/2012 at 11:30 AM
Hi Kaba:
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by MS-Moderator07 [Feedback Moderator] on 4/3/2012 at 7:47 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/3/2012 at 9:47 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 Kaba_ on 4/3/2012 at 9:55 AM
template<typename N>
class A;

template <int N>
class B {};

template <int N>
void f()
{
typedef B<N> B_AvoidBug;
auto h = [&]()
{
B_AvoidBug b;
};
}

int main()
{
f<2>();
return 0;
}