Summary: labeled break doesn't work in CTFE
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from BCS <> 2010-07-11 15:12:45 PDT 
string CTFE(string s) {
  int i, j;
  L1: for(i = 0; i < s.length; i++)
    switch(s[i]) {
      case ' ', '\n', '\r', '\t':
      default: break L1;
  L2: for(j = s.length; j > i; j--)
    switch(s[j-1]) {
      case ' ', '\n', '\r', '\t':
      default: break L2;
  return s[i..j];

import std.stdio;
pragma(msg, CTFE(" hello world!\n"));
void main(){ writef("'%s'\n", CTFE(" hello world!\n")); }

the function works at runtime but fails under CTFE. There may be a few cases
where labeled break may be hard to deal with but this one shouldn't cause

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to