Bug 6534 – const struct definition inside functions too
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-19T23:22:00Z
Last change time
2012-10-08T04:44:52Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-08-19T23:22:23Z
void foo() {
const struct Bar {}
}
void main() {}
DMD 2.055beta:
test.d(2): basic type expected, not struct
test.d(2): no identifier for declarator int
test.d(2): semicolon expected, not 'struct'
Comment #1 by bearophile_hugs — 2011-08-19T23:42:15Z
The same happens with static structs:
void foo() {
static const struct Bar {}
}
void main() {}
Comment #2 by bearophile_hugs — 2011-08-29T18:59:50Z
The same happens with immutable:
void foo() {
immutable struct Bar1 {}
static immutable struct Bar2 {}
}
void main() {}
Comment #3 by bearophile_hugs — 2011-12-15T09:36:17Z
*** Issue 7114 has been marked as a duplicate of this issue. ***