This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [C++ PATCH] Fix implicit assignment operators with anonymous aggregates


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]