[Bug c++/54665] New: [C++11] template alias to template does not work

mw_triad at users dot sourceforge.net gcc-bugzilla@gcc.gnu.org
Fri Sep 21 22:09:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54665

             Bug #: 54665
           Summary: [C++11] template alias to template does not work
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mw_triad@users.sourceforge.net


Template aliases, as described in N2258[1], are not fully implemented.
Specifically, they do not work if the type being aliased is itself a template.

Simple test case (taken from Wikipedia[2]):

template <typename First, typename Second, int Third>
class SomeType;
class OtherType;

template <typename Second>
using TypedefName = typename SomeType<OtherType, Second, 5>;

int main()
{
  return 0;
}


This fails to compile with the error:

$ gcc -std=c++11 template-alias.cpp
template-alias.cpp:6:30: error: expected nested-name-specifier



[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
[2] http://en.wikipedia.org/wiki/C++11#Alias_templates



More information about the Gcc-bugs mailing list