gcc/testsuite/gdc.test/compilable/test22646.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=22646 |
| 2 | |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | true |
| 7 | true |
| 8 | false |
| 9 | false |
| 10 | --- |
| 11 | */ |
| 12 | |
| 13 | static template Bug(string name) |
| 14 | { |
| 15 | enum bool ok = name.length < 3 || name[0..3] != "pad"; |
| 16 | } |
| 17 | |
| 18 | pragma(msg, Bug!"x".ok); |
| 19 | pragma(msg, Bug!"foo".ok); |
| 20 | pragma(msg, Bug!"pad".ok); |
| 21 | pragma(msg, Bug!"pad123".ok); |