D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7216 - [CTFE] Can't call struct member function using pointer field
Summary: [CTFE] Can't call struct member function using pointer field
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-01-03 23:51 UTC by Denis Shelomovskii
Modified: 2015-06-09 05:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2012-01-03 23:51:19 UTC
---
struct S {
    S* ptr;
    int t;  // no errors if `t` is commented
    
    void f() { }
}

int f() {
    S s0, s1;
    s0.ptr = &s1;
    s0.ptr.f(); // Error: couldn't find field ptr of type S in S(s1,0)
    return 0;
}

void main() {
    enum e = f();
}
---
Comment 1 github-bugzilla 2012-01-21 15:02:31 UTC
Commit pushed to https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/89c71d8d8e0355167fc24dc671e6aa9b385a565a
Merge pull request #633 from donc/ctfe7216

CTFE ICE bugs 7216 and 7277