D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6985 - [CTFE] Non-constant case expressions can't be interpreted
Summary: [CTFE] Non-constant case expressions can't be interpreted
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:
Depends on:
Blocks:
 
Reported: 2011-11-21 14:43 UTC by Don
Modified: 2015-06-09 05:10 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 Don 2011-11-21 14:43:01 UTC
int bug6985(int z)
{
    int q = z *2 - 6;
    switch(z)
    {
    case q:
        break;
    default:
    }
    return q;
}

static assert(bug6985(4));

test.d(13):        called from here: bug6985(4)
test.d(13): Error: static assert  (bug6985(4)) is not evaluatable at compile time