This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix implicit assignment operators with anonymous aggregates
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [C++ PATCH] Fix implicit assignment operators with anonymous aggregates
- From: Jason Merrill <jason at redhat dot com>
- Date: 21 Mar 2001 01:58:54 +0000
- Cc: mark at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- References: <20010320171848.E1635@sunsite.ms.mff.cuni.cz>
>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
> The testcase below results in error (and it did not in g++ 2.95.x), while I
> think it is completely valid. It B does not have a trivial assignment
> operator, everything compiles fine (A's assignment operator ends up
> immediate call to build (MODIFY_EXPR, ...)). The problem is that
> fixup_anonymous_aggr removes the assignment operator method, but
> build_modify_expr requires it, so it dies on anonymous union's operator= not
> being accessible.
I think I'd rather handle this in build_modify_expr; it should be a simple
matter of an additional test to avoid going to build_opfncall.
> For anonymous unions both should IMHO work right, I'm not sure about
> anonymous structures:
> I don't think we disallow anonymous structure's members to have explicit
> operator=
Hmm, if we don't we probably should.
Jason