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]
Other format: [Raw text]

[C++ PATCH] Don't create an INTEGER_CST for aggregates (empty structs)


The C++ front-end creates an INTEGER_CST with a record type which seems wrong and
could cause bugs in the future. This patch fixes it by creating an empty
constructor instead which is the correct thing to do. I found this while looking
into how to fix PR 20408 and I had originally thought this was the cause of that
PR. Anyways we create these for empty structs only when we are gimplifing
EMPTY_CLASS_EXPR.


OK? Bootstrapped and tested on powerpc-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:
	* cp-gimplify.c (cp_gimplify_expr) <case EMPTY_CLASS_EXPR>: Create an
	empty CONSTRUCTOR instead of an INTEGER_CST of zero.

Attachment: temp.diff.txt
Description: Text document


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