diff options
author | Jason Merrill <jason@redhat.com> | 2021-04-14 17:27:19 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-04-16 01:16:03 -0400 |
commit | 89c863488bc8c7315596bcb753173aa2fd8be727 (patch) | |
tree | 23f643de494414e8cbb18cf5d22fc3007daac151 /gcc/tree-vect-loop.c | |
parent | ee351f7fdbd82f8947fe9a0e74cea65d216a8549 (diff) | |
download | gcc-89c863488bc8c7315596bcb753173aa2fd8be727.zip gcc-89c863488bc8c7315596bcb753173aa2fd8be727.tar.gz gcc-89c863488bc8c7315596bcb753173aa2fd8be727.tar.bz2 |
c++: C++20 class NTTP trailing zero-init [PR100079]
The new testcase was breaking because constexpr evaluation was simplifying
Bar{Baz<42>{}} to Bar{empty}, but then we weren't treating them as
equivalent. Poking at this revealed that the code for eliding trailing
zero-initialization in class non-type template argument mangling was pretty
broken, including the test, mangle71.
I dealt with the FIXME to support RANGE_EXPR, and fixed the confusion
between a list-initialized temporary mangled as written (i.e. in the
signature of a function template) and a template parameter object mangled as
the value representation of the object. I'm distinguishing between these
using COMPOUND_LITERAL_P. A later patch will adjust the use of
COMPOUND_LITERAL_P to be more useful for this distinction, but it works now
for distinguishing these cases in mangling.
gcc/cp/ChangeLog:
PR c++/100079
* cp-tree.h (first_field): Declare.
* mangle.c (range_expr_nelts): New.
(write_expression): Improve class NTTP mangling.
* pt.c (get_template_parm_object): Clear TREE_HAS_CONSTRUCTOR.
* tree.c (zero_init_expr_p): Improve class NTTP handling.
* decl.c: Adjust comment.
gcc/testsuite/ChangeLog:
PR c++/100079
* g++.dg/abi/mangle71.C: Fix expected mangling.
* g++.dg/abi/mangle77.C: New test.
* g++.dg/cpp2a/nontype-class-union1.C: Likewise.
* g++.dg/cpp2a/nontype-class-equiv1.C: Removed.
* g++.dg/cpp2a/nontype-class44.C: New test.
Diffstat (limited to 'gcc/tree-vect-loop.c')
0 files changed, 0 insertions, 0 deletions