61827d5d9a
We're currently neglecting to set the ALIGNOF_EXPR_STD_P flag on an ALIGNOF_EXPR when its operand is an expression. This leads to us handling alignof(expr) as if it were written __alignof__(expr), and returning the preferred alignment instead of the ABI alignment. In the testcase below, this causes the first and third static_assert to fail on x86. gcc/cp/ChangeLog: PR c++/88115 * cp-tree.h (cxx_sizeof_or_alignof_expr): Add bool parameter. * decl.c (fold_sizeof_expr): Pass false to cxx_sizeof_or_alignof_expr. * parser.c (cp_parser_unary_expression): Pass std_alignof to cxx_sizeof_or_alignof_expr. * pt.c (tsubst_copy): Pass false to cxx_sizeof_or_alignof_expr. (tsubst_copy_and_build): Pass std_alignof to cxx_sizeof_or_alignof_expr. * typeck.c (cxx_alignof_expr): Add std_alignof bool parameter and pass it to cxx_sizeof_or_alignof_type. Set ALIGNOF_EXPR_STD_P appropriately. (cxx_sizeof_or_alignof_expr): Add std_alignof bool parameter and pass it to cxx_alignof_expr. Assert op is either SIZEOF_EXPR or ALIGNOF_EXPR. libcc1/ChangeLog: PR c++/88115 * libcp1plugin.cc (plugin_build_unary_expr): Pass true to cxx_sizeof_or_alignof_expr. gcc/testsuite/ChangeLog: PR c++/88115 * g++.dg/cpp0x/alignof6.C: New test. |
||
---|---|---|
.. | ||
aclocal.m4 | ||
callbacks.cc | ||
callbacks.hh | ||
cc1plugin-config.h.in | ||
ChangeLog | ||
compiler-name.hh | ||
configure | ||
configure.ac | ||
connection.cc | ||
connection.hh | ||
findcomp.cc | ||
findcomp.hh | ||
libcc1.cc | ||
libcc1.sym | ||
libcc1plugin.cc | ||
libcc1plugin.sym | ||
libcp1.cc | ||
libcp1plugin.cc | ||
libcp1plugin.sym | ||
Makefile.am | ||
Makefile.in | ||
marshall-c.hh | ||
marshall-cp.hh | ||
marshall.cc | ||
marshall.hh | ||
names.cc | ||
names.hh | ||
rpc.hh | ||
status.hh |