template<unsigned N, typename... T> struct aligned_union { alignas(T...) char data[N]; }; int main() { aligned_union<8, double> a; }
a.cc:4:12: error: expected ‘)’ before ‘...’ token alignas(T...) char data[N]; ^ a.cc:4:12: error: expected ‘)’ before ‘...’ token a.cc:4:12: error: expected unqualified-id before ‘...’ token
Looks like quite a bit is unimplemented about this, both in the parser and in pt.c. I mean to have a look.
*** Bug 62136 has been marked as a duplicate of this bug. ***
Author: jason Date: Fri May 8 04:42:06 2015 New Revision: 222902 URL: https://gcc.gnu.org/viewcvs?rev=222902&root=gcc&view=rev Log: PR c++/59012 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion. (cp_parser_std_attribute_spec): Handle alignas pack expansion. * decl2.c (is_late_template_attribute): An attribute exp is dependent. * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion. (apply_late_template_attributes): Handle attribute pack expansion. Added: trunk/gcc/testsuite/g++.dg/cpp0x/alignas4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl2.c trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c
Author: jason Date: Fri May 8 21:15:21 2015 New Revision: 222927 URL: https://gcc.gnu.org/viewcvs?rev=222927&root=gcc&view=rev Log: PR c++/59012 * parser.c (cp_parser_std_attribute_list): Handle attribute expansion. (cp_parser_std_attribute_spec): Handle alignas pack expansion. * decl2.c (is_late_template_attribute): An attribute exp is dependent. * pt.c (make_pack_expansion): Allow TREE_LIST for attribute expansion. (apply_late_template_attributes): Handle attribute pack expansion. Added: branches/gcc-5-branch/gcc/testsuite/g++.dg/cpp0x/alignas4.C Modified: branches/gcc-5-branch/gcc/cp/ChangeLog branches/gcc-5-branch/gcc/cp/decl2.c branches/gcc-5-branch/gcc/cp/parser.c branches/gcc-5-branch/gcc/cp/pt.c
Fixed on trunk by r222902 and bacported to 5.x branch in r222927.