[Bug c++/69065] [C++11] multiple alignas specifiers
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 4 03:41:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69065
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |msebor at gcc dot gnu.org
Resolution|--- |INVALID
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The parameter pack problem mentioned in the Description is the subject of bug
59012. It's fixed on trunk and as of r222927 it should also be fixed on the
5.x branch.
That said, the test cases in the Description and comment #2 are invalid. The
grammar term is alignas(type-id ...opt), where the <opt> part goes with the
ellipsis and means a literal optional ellipsis (thus denoting a template
parameter pack expansion), not an optional second type-id. Here's an example
of the use of this construct that compiles successfully with 6.0:
$ cat u.cpp && /home/msebor/build/gcc-trunk-svn/gcc/xg++
-B/home/msebor/build/gcc-trunk-svn/gcc -S -Wall -Wextra -o/dev/null u.cpp
template <class ...T> struct A {
struct alignas (T...) B { char c; };
};
typedef A<int, double> Aid;
#define ASSERT(e) static_assert (e, #e)
ASSERT (alignof (Aid::B) == alignof (double));
$
More information about the Gcc-bugs
mailing list