This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 65579 ("gcc requires definition of a static constexpr member...")
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Oct 2017 21:12:10 +0200
- Subject: Re: [C++ Patch] PR 65579 ("gcc requires definition of a static constexpr member...")
- Authentication-results: sourceware.org; auth=none
- References: <f763a8ed-ad24-8054-ddca-9380b30d4612@oracle.com> <CADzB+2mPpZczui=AgcipRSsyADy67YNH7Nn+Oxn2LP8YNQeWNA@mail.gmail.com>
Hi Jason,
On 24/10/2017 20:58, Jason Merrill wrote:
On Tue, Sep 26, 2017 at 4:28 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
Hi,
this is a relatively old bug already analyzed by Martin last year. He also
proposed a patch:
https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00593.html
After a short exchange Jason proposed a different approach based on simply
completing the involved vars:
https://gcc.gnu.org/ml/gcc-patches/2016-03/msg01420.html
Having verified that Martin wasn't actively working on the bug, I decided to
try a very straightforward implementation of Jason's suggestion - see the
attached, tested x86_64-linux - which appears to work fine as-is. Naturally,
one could imagine restricting/enlarging the set of decls to complete: some
choices don't seem good, like extending to non-constepr vars too (the
corresponding snippet is ill formed anyway due to the initialization). I
didn't try to test all the possible variants...
This seems like an odd place to add the complete_type call.
Indeed. Wanted to at least try the minimal change, worked surprisingly well.
What
happens if we change the COMPLETE_TYPE_P (type) in
cp_apply_type_quals_to_decl to COMPLETE_TYPE_P (complete_type (type))?
I'll let you know asap, thanks for the suggestion!
Paolo.