Search

ctp compiler crash on variadic template code by summerlight

Active

2
0
Sign in
to vote
Type: Bug
ID: 771522
Opened: 11/18/2012 3:13:08 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
ctp compiler crashes on below code

template<typename... T>
struct a
{
    template<typename head, typename... remainder>
    void init()
    {
    }

    template<>
    void init()
    {
    }
};

int main()
{
}

Though above code is not legimate code (though msvc extension allows it), proper compile error/warning message is expected rather than compiler crash.
Details (expand)

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

Visual Studio 2012

Steps to reproduce

Compile above code.

Product Language

English

Operating System

Windows 7

Operating System Language

Korean

Actual results

Compiler crash

Expected results

Proper error/warning message (something about explicit specialization)
File Attachments
0 attachments
Sign in to post a comment.
Posted by UnitUniverse on 12/6/2012 at 3:33 AM
@Microsoft: The title of this report should have been marked as '[Codename Milan]'. It's ignored by mistake by its author.
Posted by UnitUniverse on 12/6/2012 at 3:28 AM
// ConsoleApplication1.cpp : Defines the entry point for the console application.
// It can be compiled.

#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <iostream>


template<typename... T>
struct a
{
    template < typename head, typename... remainder >
    void init()
    {
    }

    //template <>
    void init()
    {
    }

    template <>
    void init<int>()
    {
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    a<> o1;

    o1.init<int, int>();
    o1.init<float>();
    o1.init<int>();
    o1.init();

    _getch();
    return 0;
}
Posted by UnitUniverse on 12/6/2012 at 3:20 AM
This might be compiled if i removed the third 'template' line (template <>):

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <iostream>


template<typename... T>
struct a
{
    template<typename head, typename... remainder>
    void init()
    {
    }

    //template<>
    void init()
    {
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    a<> o1;

    o1.init<int>();
    o1.init();

    _getch();
    return 0;
}
Posted by Microsoft on 11/19/2012 at 10:03 PM
Thanks for your feedback.

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