Skip to content
Snippets Groups Projects
Commit f7b7fe16 authored by Andrew Pinski's avatar Andrew Pinski
Browse files

c++: Add support for vec_dup to constexpr [PR118445]


With the addition of supporting operations on the SVE scalable vector types,
the vec_duplicate tree will show up in expressions and the constexpr handling
was not done for this tree code.
This is a simple fix to treat VEC_DUPLICATE like any other unary operator and allows
the constexpr-add-1.C testcase to work.

Built and tested for aarch64-linux-gnu.

	PR c++/118445

gcc/cp/ChangeLog:

	* constexpr.cc (cxx_eval_constant_expression): Handle VEC_DUPLICATE like
	a "normal" unary operator.
	(potential_constant_expression_1): Likewise.

gcc/testsuite/ChangeLog:

	* g++.target/aarch64/sve/constexpr-add-1.C: New test.

Signed-off-by: default avatarAndrew Pinski <quic_apinski@quicinc.com>
parent c864ffe6
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment