Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c++/modules: complete_vars ICE with non-exported constexpr var
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here during stream-in of the non-exported constexpr var 'a' we call maybe_register_incomplete_var, which ends up taking the second branch and pushing {a, NULL_TREE} onto incomplete_vars. We later ICE from complete_vars due to this NULL_TREE class context. Judging by the two commits that introduced/modified this part of maybe_register_incomplete_var, r196852 and r214333, ISTM this branch is really only concerned with constexpr static data members (whose initializer may contain a pointer-to-member for a currently open 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 currently open class. gcc/testsuite/ChangeLog: * g++.dg/modules/cexpr-4_a.C: New test. * g++.dg/modules/cexpr-4_b.C: New test.
- Loading branch information