Bug 63878 - Fails to compile 'union __attribute__((...))'
Summary: Fails to compile 'union __attribute__((...))'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc3
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-04-19 23:42 UTC by Enrico Scholz
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-04-29 12:50:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Enrico Scholz 2002-04-19 23:42:23 UTC
Description of Problem:

Trying to compile

| struct foo {
|     union __attribute__ ((packed))
|     {
|     };
| };

fails with

| g++3 -c attr.cc
| attr.cc:3: `class' tag used in naming `union foo::<anonymous>'


Compiling with gcc-2.96, s!union!struct! or placing the
'__attribute__((packed))' after the closing brace succeeds. The gcc
documentation states in "Type Attributes"

|    You may also specify attributes between the enum, struct or union
| tag and the name of the type rather than after the closing brace.

so the code should be correctly.


Version-Release number of selected component (if applicable):

gcc3-3.1-0.23.1

Comment 1 Jakub Jelinek 2002-04-29 12:50:37 UTC
Fixed in gcc 3.1 CVS, will be in gcc-3.1-0.26.


Note You need to log in before you can comment on or make changes to this bug.