Xref: utzoo gnu.gcc.bug:1976 comp.lang.c++:6535 comp.std.c:2480 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: gnu.gcc.bug,comp.lang.c++,comp.std.c Subject: Re: Extremely minor bug with enumerations Message-ID: <25DDC633.19611@paris.ics.uci.edu> Date: 17 Feb 90 21:46:28 GMT References: <9002161652.AA01478@armory> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Distribution: gnu Organization: UC Irvine Department of ICS Lines: 14 In article <9002161652.AA01478@armory> kendall%saber@HARVARD.HARVARD.EDU writes: >This file should not compile (gcc -c t.c), but does: > > enum foo { a = sizeof (enum foo) }; > >Although the ANSI draft (3.5.2.2) doesn't specify, the type `enum foo' >should not be complete until the closing right brace. For example, in >an implementation that puts some enums into single bytes, the size of >`enum foo' can't be known until after the close brace. I believe that such code is legal, but perhaps someone with more authority will comment. // rfg