D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1355 - Can't declare struct with align attribute in a statement body.
Summary: Can't declare struct with align attribute in a statement body.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2007-07-20 15:38 UTC by Aziz Köksal
Modified: 2019-06-02 06:20 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Aziz Köksal 2007-07-20 15:38:22 UTC
void foo()
{
  align (1) struct bar { int a; }
}
Comment 1 Manuel König 2010-03-08 09:33:11 UTC
I ran into this bug on LDC too (don't have dmd at hand), see this closed bug: http://www.dsource.org/projects/ldc/ticket/399 .

It turns out that it's probably a parse error (which implies that it's most likely not implemented in the back end too). Christian Kamm could also reproduce this on dmd. I don't know which version he used though, probably one of the newer 1.05x releases.

As a workaround you can of course declare the struct on module level.
Comment 2 Mathias LANG 2019-06-02 06:20:53 UTC
Fixed in D2