diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-03-01 16:50:20 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-03-01 16:50:20 -0500 |
commit | e15ef78e4a1e50a51a92468e32186fbad59dd628 (patch) | |
tree | b6ac2b3006da2c94f1e61ef9293d819a585913c5 /gcc/tree-vect-loop.cc | |
parent | c7607c4cf18986025430ca8626abfe56bfe87106 (diff) | |
download | gcc-e15ef78e4a1e50a51a92468e32186fbad59dd628.zip gcc-e15ef78e4a1e50a51a92468e32186fbad59dd628.tar.gz gcc-e15ef78e4a1e50a51a92468e32186fbad59dd628.tar.bz2 |
c++/modules: complete_vars ICE with non-exported constexpr var
Here after stream-in of the non-exported constexpr global 'A a' we call
maybe_register_incomplete_var, which we'd expect to be a no-op here but
it manages to take its second branch and pushes {a, NULL_TREE} onto
incomplete_vars. Later after defining B we ICE from complete_vars due
to this pushed NULL_TREE class context.
Judging by the two commits that introduced/modified this part of
maybe_register_incomplete_var, r196852 and r214333, it seems this second
branch is only concerned with constexpr static data members (whose
initializer may contain a pointer-to-member for a not-yet-complete class)
So this patch restricts this branch accordingly so it's not inadvertently
taken during stream-in.
gcc/cp/ChangeLog:
* decl.cc (maybe_register_incomplete_var): Restrict second
branch to static data members from a not-yet-complete class.
gcc/testsuite/ChangeLog:
* g++.dg/modules/cexpr-4_a.C: New test.
* g++.dg/modules/cexpr-4_b.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/tree-vect-loop.cc')
0 files changed, 0 insertions, 0 deletions