D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11964 - Poor diagnostic in static assert with boolean operators
Summary: Poor diagnostic in static assert with boolean operators
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2014-01-22 02:26 UTC by monarchdodra
Modified: 2020-03-21 03:56 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 monarchdodra 2014-01-22 02:26:41 UTC
//----
void main()
{
    enum a = 0;
    enum b = 1;
    enum c = 2;
    static assert(b < a && a < b && b < c);
}
//----

This creates:
//----
Error: static assert  (false && 1 < 2) is false
//----

This is not helpful at all.
Comment 1 bearophile_hugs 2014-01-22 02:48:29 UTC
Related to Issue 5004 ?
Comment 2 monarchdodra 2014-01-22 03:13:42 UTC
I think they are both ER on a same feature, yes, but the "root issue" seems completely different.

5004 is about aliases. This is about which value you actually show when the assert is triggered.
Comment 3 basile-z 2020-02-20 15:34:13 UTC
The original expression is maintained now

Error: static assert:  `1 < 0 && (a < b) && (b < c)` is false