gcc/libcc1
Patrick Palka 61827d5d9a c++: Correct the handling of alignof(expr) [PR88115]
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.
2020-11-11 14:43:38 -05:00
..
ChangeLog Daily bump. 2020-11-11 00:16:36 +00:00
Makefile.am libcc1: Enable Intel CET on Intel CET enabled host 2020-05-12 09:12:37 -07:00
Makefile.in libcc1: Enable Intel CET on Intel CET enabled host 2020-05-12 09:12:37 -07:00
aclocal.m4 libcc1: Enable Intel CET on Intel CET enabled host 2020-05-12 09:12:37 -07:00
callbacks.cc Update copyright years. 2020-01-01 12:51:42 +01:00
callbacks.hh Update copyright years. 2020-01-01 12:51:42 +01:00
cc1plugin-config.h.in
compiler-name.hh Update copyright years. 2020-01-01 12:51:42 +01:00
configure Require CET support only for the final GCC build 2020-07-30 05:36:24 -07:00
configure.ac libcc1: Enable Intel CET on Intel CET enabled host 2020-05-12 09:12:37 -07:00
connection.cc Update copyright years. 2020-01-01 12:51:42 +01:00
connection.hh Update copyright years. 2020-01-01 12:51:42 +01:00
findcomp.cc Update copyright years. 2020-01-01 12:51:42 +01:00
findcomp.hh Update copyright years. 2020-01-01 12:51:42 +01:00
libcc1.cc Update copyright years. 2020-01-01 12:51:42 +01:00
libcc1.sym Introduce C++ support in libcc1 2017-01-31 01:02:03 +00:00
libcc1plugin.cc core: Rename DECL_IS_BUILTIN -> DECL_IS_UNDECLARED_BUILTIN 2020-11-06 10:50:51 -08:00
libcc1plugin.sym
libcp1.cc Update copyright years. 2020-01-01 12:51:42 +01:00
libcp1plugin.cc c++: Correct the handling of alignof(expr) [PR88115] 2020-11-11 14:43:38 -05:00
libcp1plugin.sym Introduce C++ support in libcc1 2017-01-31 01:02:03 +00:00
marshall-c.hh Update copyright years. 2020-01-01 12:51:42 +01:00
marshall-cp.hh Update copyright years. 2020-01-01 12:51:42 +01:00
marshall.cc Update copyright years. 2020-01-01 12:51:42 +01:00
marshall.hh Update copyright years. 2020-01-01 12:51:42 +01:00
names.cc Update copyright years. 2020-01-01 12:51:42 +01:00
names.hh Update copyright years. 2020-01-01 12:51:42 +01:00
rpc.hh Update copyright years. 2020-01-01 12:51:42 +01:00
status.hh Update copyright years. 2020-01-01 12:51:42 +01:00