Home Dashboard Directory Help
Search

Alias template issue involving non-type template parameter and two levels of template aliasing. by Cassio Neri


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 808130
Opened: 11/8/2013 3:43:27 PM
Access Restriction: Public
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

The code below fails to compile (but it does with gcc 4.8.1, clang 3.3 and icc 13.1.1) yielding the following:

error C2955: 'bar' : use of alias template requires template argument list

It seems that the main ingredients for this error two occur are:

1. A non-type template parameter ('bool' of 'foo');
2. Two levels of template aliasing ('baz' alias 'bar' which alias 'foo').

Given the error message (C2955) this bug might be a duplicate of
https://connect.microsoft.com/VisualStudio/feedback/details/800231/c-11-alias-template-issue

#include <type_traits>

template <bool>
struct foo {};

template <typename T>
using bar = foo<std::is_scalar<T>::value>;

template <typename T>
using baz = bar<T>;
Details
Sign in to post a comment.
Posted by Microsoft on 11/10/2013 at 6:36 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 11/8/2013 at 3:51 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.
Posted by Cassio Neri on 11/8/2013 at 3:48 PM
Subistitute `baz` shown in the description with this:

template <typename T, typename U = bar<T>>
using baz = U;