Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c++: sizeof(expr) in non-templated requires-expr [PR108563]
When substituting into sizeof(expr), tsubst_copy_and_build elides substitution into the operand if args is NULL_TREE, and instead considers the TREE_TYPE of the operand. But here the (templated) operand is a TEMPLATE_ID_EXPR with empty TREE_TYPE, so we can't elide substitution in this case. Contrary to the associated comment (dating back to r69130) substituting args=NULL_TREE should generally work since we do exactly that in e.g. fold_non_dependent_expr, and I don't see why the operand of sizeof would be an exception. So this patch just removes this special case. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Diff generated with -w to ignore noisy whitespace changes. PR c++/108563 gcc/cp/ChangeLog: * pt.cc (tsubst_copy_and_build) <case SIZEOF_EXPR>: Remove special case for empty args. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires35.C: New test.
- Loading branch information