https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117689

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |sandra at gcc dot 
gnu.org
                 CC|                            |sandra at gcc dot gnu.org

--- Comment #1 from sandra at gcc dot gnu.org ---
I'm looking at this.

It appears that the existing text in "Incomplete enums" is wrong about e.g.

enum e;

producing an incomplete type, as gcc is allowing me to declare e.g.

static enum e thing;

at file scope without complaint as long as there is a subsequent full
declaration of the enum in the compilation unit, after the point of use.  It
seems to be defaulting to using int as the underlying type, or char if I use
-fshort-enums, but I'm having trouble finding the place where that happens.  Is
that a bug in the docs or a bug in the implementation that it isn't rejecting
that?  It does complain about the use if there is no redeclaration of the enum.

Of course there is no problem if the underlying type is specified explicitly. 
That is the C++11 requirement too.  The C++ spec refers to the resulting type
as "opaque" rather than "incomplete" for this reason.

Anyway, my plan is to merge the information about specifying the underlying
type into the existing section about forward declarations since they are
closely related in terms of what you can and can't do.

Reply via email to