[Bug c++/68267] New: over-aligning with alignas() doesn't work
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Nov 10 06:58:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68267
Bug ID: 68267
Summary: over-aligning with alignas() doesn't work
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
markus@x4 /tmp % cat test.cpp
#include <cstddef>
static constexpr std::size_t alignment = 256;
struct alignas(alignment) foo {
char c;
};
static_assert(alignof(foo) == alignment, "");
markus@x4 /tmp % icpc -c -std=c++14 test.cpp
markus@x4 /tmp % clang++ -c -std=c++14 test.cpp
markus@x4 /tmp % g++ -c -std=c++14 test.cpp
test.cpp:3:27: warning: requested alignment 256 is larger than 128
[-Wattributes]
struct alignas(alignment) foo {
^
test.cpp:6:1: error: static assertion failed:
static_assert(alignof(foo) == alignment, "");
^
More information about the Gcc-bugs
mailing list