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

Gabriel Dos Reis gdr@integrable-solutions.net
Sat Mar 12 04:16:00 GMT 2005


Paolo Carlini <pcarlini@suse.de> writes:

| Hi Andrew,
| 
| and, first, thanks for the help.
| 
| > 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.
| 
| I wonder (very naively, sorry) why this construction work?!? I mean,
| if the memory allocated for an EMPTY_CLASS_EXPR is considered simply
| as a data member of built-in type, automatically no actual
| construction is needed. I must be missing something (ABI-related?)

A CONSTRUCTOR is the GCC word for brace-encloded data.

-- Gaby



More information about the Gcc-patches mailing list