Issue 81 - incorrect statement is not reachable in 0.18
Summary: incorrect statement is not reachable in 0.18
Status: RESOLVED DUPLICATE of issue 82
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 minor
Assignee: Brad Roberts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-02 21:56 UTC by Christopher Lane Hinson
Modified: 2015-06-09 05:15 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Christopher Lane Hinson 2006-04-02 21:56:32 UTC
This is from the version hosted at http://www.puremagic.com/~braddr/d/gdc/

======= example.d =======

module example;

import std.c.stdio, std.string;

void foo() {
  printf( toStringz( "foo!" ) );
}

void bar() {
  printf( toStringz( "bar!" ) );
}

void main( char[][] args ) {
  switch( args[1] ) {
    debug {
      case "--foo":
      case "-f":
        foo();
        break;
    }
    version( bar ) {
      case "--bar":
      case "-b":
        bar();
        break;
    }
    default:
      foo();
      bar();
      break;
  }
}

======== ========

lane@wookies:~$ gdc --version
gdc (GCC) 4.0.3 (gdc 0.18-alpha-1, using dmd 0.148)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

lane@wookies:~$ gdc -fdebug -fversion=bar -Wall example.d
warning - example.d:21: statement is not reachable
Comment 1 Brad Roberts 2006-04-02 23:35:15 UTC
Have you tried this with dmd itself?  It's unlikely that this is a gdc 
specific bug.

Comment 2 Christopher Lane Hinson 2006-04-03 01:07:52 UTC
It's a frontend bug.  Sorry.  I'll check against dmd in the future.

*** This bug has been marked as a duplicate of 82 ***
Comment 3 Walter Bright 2006-06-18 02:24:38 UTC
Works with DMD 0.160.