Search

[Codename Milan] Variadic templates and nested type names by Brandon Kentel

Active

1
0
Sign in
to vote
Type: Bug
ID: 779557
Opened: 2/19/2013 6:28:14 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
#include <array>
#include <tuple>

template <typename T, unsigned N>
struct attribute {
    typedef std::array<T, N> type;
};

template <typename Attr, typename... Attrs>
struct attribute_set {
    typedef std::tuple<typename Attr::type, typename Attrs::type...> type;
};

typedef attribute_set<
    attribute<int, 2>,
    attribute<double, 2>,
    attribute<char, 2>
> my_set_t;

int main(int argc, char const* argv[]) {
    my_set_t::type my_set;
    
    return 0;
}
Details (expand)

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

Visual Studio 2012

Steps to reproduce

#include <array>
#include <tuple>

template <typename T, unsigned N>
struct attribute {
    typedef std::array<T, N> type;
};

template <typename Attr, typename... Attrs>
struct attribute_set {
    typedef std::tuple<typename Attr::type, typename Attrs::type...> type;
};

typedef attribute_set<
    attribute<int, 2>,
    attribute<double, 2>,
    attribute<char, 2>
> my_set_t;

int main(int argc, char const* argv[]) {
    my_set_t::type my_set;
    
    return 0;
}

Product Language

English

Operating System

Windows 7 SP1

Operating System Language

English

Actual results

testvc.cpp --\testvc.cpp(11) : error C3546: '...' : there are no parameter packs available to expand --\testvc.cpp(21) : see reference to class template instantiation 'attribute_set<attribute<int,2>,attribute<double,2>,attribute<char,2>>' being compiled --\testvc.cpp(21) : error C2079: 'my_set' uses undefined class 'std::tuple<std::array<T,2>,Attrs::type,std::_Nil,std::_Nil,std::_Nil,std::_Nil,std::_Nil,std::_Nil>' with [ T=int ]

Expected results

Clean compilation (works under GCC etc).
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 2/20/2013 at 10:06 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 Microsoft on 2/19/2013 at 6:53 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.