This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55013] New: variadic sizeof non-constant with alias template


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: unassigned@gcc.gnu.org
        ReportedBy: pkeir@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]