This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55013] New: variadic sizeof non-constant with alias template
- From: "pkeir at outlook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Oct 2012 22:30:10 +0000
- Subject: [Bug c++/55013] New: variadic sizeof non-constant with alias template
- Auto-submitted: auto-generated
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