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



             Bug #: 55013

           Summary: variadic sizeof non-constant with alias template

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: pk...@outlook.com





Created attachment 28500

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28500

Code that produces the error



The following code fails to compile as the size of the variadic template

parameter pack Ts is considered to be non-constant:



template <typename ...Ts>

struct Foo {};



template <std::size_t I>

using PI = int;



template <typename ...Ts>

PI<sizeof...(Ts)> q(Foo<Ts...>) {

  return PI<sizeof...(Ts)>(42);

}



With GCC 4.7.2 and Clang 3.2 there is no problem. I am using GCC snapshot 4.8.0

20121014 under Ubuntu.



Compiled with:



g++ -std=c++11 -c alias.cpp

Reply via email to