Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #399 (closed defect: invalid)

Opened 15 years ago

Last modified 15 years ago

aligning structs inside functions doesn't work

Reported by: manuel Assigned to: ChristianK
Priority: major Milestone:
Component: unspecified Version: hg tip
Keywords: Cc:

Description

Create a file foo.d

void main()
{
    align(1) struct S { }
}
ldc foo.d
foo.d(3): found 'align' instead of statement
foo.d(4): unrecognized declaration

The alignment can also be any other value than 1, and S can contain any members. In fact it's a parsing error:

ldc -v foo.d
config    /path/to/my/ldc.conf
parse     foo
foo.d(3): found 'align' instead of statement
foo.d(4): unrecognized declaration

Declaring an aligned struct outside of functions works, though.

Change History

(follow-up: ↓ 2 ) 03/08/10 16:32:36 changed by ChristianK

  • status changed from new to closed.
  • resolution set to invalid.

Hi manuel. I can reproduce this with DMD and thus this is a bug in the DMD frontend. Please report this on http://d.puremagic.com/issues/ .

(in reply to: ↑ 1 ) 03/08/10 17:35:20 changed by manuel

Sorry for reporting at the wrong end, but I don't have a dmd at hand on my x86_64 linux platform. I found that it was already reported two and a half years ago for dmd here: http://d.puremagic.com/issues/show_bug.cgi?id=1355 . I commented on that bug to hopefully bring it up to Walt's attention :)

Copyright © 2008, LDC Development Team.