[Issue 3244] with -inline dmd sometime instantiates nested functions that then cannot be accessed

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3244


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||DUPLICATE


--- Comment #2 from Don clugd...@yahoo.com.au 2010-09-13 23:55:41 PDT ---
This has no test case, but has the same behaviour as bug 2474. Therefore, I'm
marking it as a duplicate.

*** This issue has been marked as a duplicate of issue 2474 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 2474] Recursive lazy arguments are inlined incorrectly

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2474


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||fa...@gmx.ch


--- Comment #4 from Don clugd...@yahoo.com.au 2010-09-13 23:55:41 PDT ---
*** Issue 3244 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4304] default arguments using delegates of a global object no longer work

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4304


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||clugd...@yahoo.com.au
 Resolution||DUPLICATE


--- Comment #1 from Don clugd...@yahoo.com.au 2010-09-13 23:57:26 PDT ---
Same root cause as bug 4820.

*** This issue has been marked as a duplicate of issue 4820 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4820] Regression(1.058, 2.044) in DStress caused by changeset 452

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4820


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||fa...@gmx.ch


--- Comment #2 from Don clugd...@yahoo.com.au 2010-09-13 23:57:27 PDT ---
*** Issue 4304 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4864] New: ICE(statement.c) Crash on invalid 'if statement' body inside mixin

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4864

   Summary: ICE(statement.c) Crash on invalid 'if statement' body
inside mixin
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: yebbl...@gmail.com


--- Comment #0 from yebblies yebbl...@gmail.com 2010-09-14 00:01:51 PDT ---
- reduced test case -

void main()
{
mixin(if (0) % ;);
}
-

IfStatement::semantic is called with (ifbody == null)
Seems like something that should be detected during parsing of the mixin.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4820] Regression(1.058, 2.044) in DStress caused by changeset 452

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4820


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 Depends on||4440


--- Comment #3 from Don clugd...@yahoo.com.au 2010-09-14 00:02:29 PDT ---
Although this particular case used to work, it was very fragile.
Calling nextis() directly from main() never worked.
This whole feature probably won't correctly until delegate literals can be
inlined.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4518] to!string(enum w/invalid value) produces a somewhat unhelpful error

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4518


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #1 from Brad Roberts bra...@puremagic.com 2010-09-14 01:13:51 PDT 
---
Fixed by rsinfu in:
http://www.dsource.org/projects/phobos/changeset/1961

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4865] New: Post-position attributes cannot be used with auto return functions

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4865

   Summary: Post-position attributes cannot be used with auto
return functions
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: samu...@voliacable.com


--- Comment #0 from Max Samukha samu...@voliacable.com 2010-09-14 07:47:27 
PDT ---
struct S
{
auto foo() const //line 8
{
return 1; //line 10
}
}

void main()
{
}

test.d(8): no identifier for declarator foo
test.d(8): semicolon expected, not 'pure'
test.d(10): Declaration expected, not 'return'

Applies to any attribute that can be specified after the declaration. The
example compiles if the return type is explicitly specified or the attribute is
put in front of the declaration.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4863] DWARF debug symbols treat arrays as unsigned long long

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4863



--- Comment #2 from Juergen Lock bugs-purema...@jelal.kn-bremen.de 2010-09-14 
10:31:30 PDT ---
Maybe I was not clear :)  The problem is this:

% dmd -w -g xzj.d lzma/lzma.d -L-llzma
% grep main.\*args xzj.d
void main(string[] args)
% ngdb.new ./xzj
(ngdb) b _Dmain
Id  Enb AddressWhere
1   y   0x804a077  D main(unsigned long long args): xzj.d:256
  ^^^
(ngdb) r foo bar
Stopped at breakpoint 1
D main(args=2895955435326537731): xzj.d:256

= 259*// --debug
(ngdb) p *cast(char [][] *)args
$0 = (char[][]) [./xzj, foo, bar]
(ngdb) q

(same with the patched gdb only that doesn't understand the cast.)

 And meanwhile I found out this doesn't happen always:

% cat args.d
import std.stdio;

void main(string[] args)
{
foreach(arg; args)
writeln(arg);
}
% dmd -g -w args.d
% ngdb.new ./args
(ngdb) b _Dmain
Id  Enb AddressWhere
1   y   0x80491fb  D main(char[][] args): args.d:5
(ngdb) r foo bar
Stopped at breakpoint 1
D main(args=[./args, foo, bar]): args.d:5
=   5*foreach(arg; args)
(ngdb) q

So now I probably should extract the most simple testcase that exhibits the
bug, I haven't done that yet so for now here are links to the xzj source:

http://people.freebsd.org/~nox/tmp/d/xzj.d
http://people.freebsd.org/~nox/tmp/d/lzma.d

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4866] New: Static-to-dynamic converted manifest constant array gets non-converted type in static/constraint if

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4866

   Summary: Static-to-dynamic converted manifest constant array
gets non-converted type in static/constraint if
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: rsi...@gmail.com


--- Comment #0 from Shin Fujishiro rsi...@gmail.com 2010-09-14 11:03:49 PDT 
---
If a compile-time constant of type T[N] is converted to a manifest constant of
type T[], then the manifest constant gets a wrong type T[N] in static-if or
template constraints.

In the following code, typeof(dynamic) is correct in static-assert, but wrong
in static-if.
 test1.d
immutable int[3] statik = [ 1, 2, 3 ];
enum immutable(int)[] dynamic = statik;

static assert(is(typeof(dynamic) == immutable(int)[]));
static if (! is(typeof(dynamic) == immutable(int)[]))
{
static assert(0);   // (7)
}
pragma(msg, !! , typeof(dynamic));

% dmd -c -o- test1.d
!! immutable(int[3u])
test1.d(7): Error: static assert  (0) is false

Note the pragma output.  Its type is the original static one.

The same happens in template constraint:
 test2.d
void main()
{
immutable char[3] statik = abc;
enum string dynamic = statik;
foo(dynamic);   // (5)
}
void foo(T)(T a) if (is(typeof(T) == string)) {}

% dmd -c -o- test2.d
test2.d(5): Error: template test2.foo(T) if (is(typeof(T) == string)) does not
match any function template declaration
test2.d(5): Error: template test2.foo(T) if (is(typeof(T) == string)) cannot
deduce template function from argument types !()(string)


It's ok if a constant is a scalar:
 test3.d
immutable int original = 10;
enum real converted = original;

static assert(is(typeof(converted) == real));
static if (! is(typeof(converted) == real)) static assert(0);

% dmd -c -o- test3.d
% _


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4863] DWARF debug symbols treat arrays as unsigned long long

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4863



--- Comment #3 from Juergen Lock bugs-purema...@jelal.kn-bremen.de 2010-09-14 
11:06:33 PDT ---
And btw I can confirm Linux is affected too:

% readelf -w linux/xzj
..
 16bb: Abbrev Number: 3 (DW_TAG_base_type)
 DW_AT_name: unsigned long long 
 DW_AT_byte_size   : 8  
 DW_AT_encoding: 7  (unsigned)
..
 211c1: Abbrev Number: 6 (DW_TAG_formal_parameter)
 DW_AT_name: args   
 DW_AT_type: 6bb  
 DW_AT_location: 2 byte block: 91 8 (DW_OP_fbreg: 8)

 vs.

% readelf -w linux/args
 162: Abbrev Number: 3 (DW_TAG_base_type)
 DW_AT_name: char   
 DW_AT_byte_size   : 1  
 DW_AT_encoding: 8  (unsigned char)
 16a: Abbrev Number: 4 (Unknown TAG value: 41)
 DW_AT_byte_size   : 8  
 DW_AT_type: 62
 170: Abbrev Number: 4 (Unknown TAG value: 41)
 DW_AT_byte_size   : 8  
 DW_AT_type: 6a
..
 2a5: Abbrev Number: 5 (DW_TAG_formal_parameter)
 DW_AT_name: args   
 DW_AT_type: 70   
 DW_AT_location: 2 byte block: 91 8 (DW_OP_fbreg: 8)

I've put the binaries here:

http://people.freebsd.org/~nox/tmp/d/linux/xzj
http://people.freebsd.org/~nox/tmp/d/linux/args

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3273] Regression(2.031): struct invariant + dtor fails to compile (no line number)

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3273


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||patch


--- Comment #5 from Don clugd...@yahoo.com.au 2010-09-14 11:42:15 PDT ---
PATCH: A normal opAssign, such as in the case below, does not have 'isref' set. 

struct A {
A opAssign(A a){ return this; }
}

Compiler-generated opAssign shouldn't either.


clone.c line 143,  StructDeclaration::buildOpAssign()

Parameter *param = new Parameter(STCnodtor, type, Id::p, NULL);
Parameters *fparams = new Parameters;
fparams-push(param);
Type *ftype = new TypeFunction(fparams, handle, FALSE, LINKd);
-#if STRUCTTHISREF
-((TypeFunction *)ftype)-isref = 1;
-#endif

fop = new FuncDeclaration(0, 0, Id::assign, STCundefined, ftype);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4867] New: Postblit is not usable with const objects

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4867

   Summary: Postblit is not usable with const objects
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: critical
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: samu...@voliacable.com


--- Comment #0 from Max Samukha samu...@voliacable.com 2010-09-14 12:32:35 
PDT ---
struct S
{
this(this)
{
}
}

void foo(ref const S s)
{
auto s2 = s;
}

void main()
{  
}

Error: function test.S.__cpctor (ref S p) is not callable using argument types
(const(S)) const

It is not specified how postblit is supposed to interoperate with
const/immutable. Tagging the postblit function with 'const' doesn't help
(compilation fails with the same error).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4863] DWARF debug symbols treat arrays as unsigned long long

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4863



--- Comment #4 from Juergen Lock bugs-purema...@jelal.kn-bremen.de 2010-09-14 
15:48:14 PDT ---
Created an attachment (id=756)
reduced testcase that exhibits the bug

Ok I have a minmal testcase now, all it took was a local variable:

% readelf -w linux/argsfoo
..
 17c: Abbrev Number: 3 (DW_TAG_base_type)
 DW_AT_name: unsigned long long 
 DW_AT_byte_size   : 8  
 DW_AT_encoding: 7  (unsigned)
..
 2c1: Abbrev Number: 5 (DW_TAG_formal_parameter)
 DW_AT_name: args   
 DW_AT_type: 7c   
 DW_AT_location: 2 byte block: 91 8 (DW_OP_fbreg: 8)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4868] New: optlink doesn't complain about wrong extern declaration

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4868

   Summary: optlink doesn't complain about wrong extern
declaration
   Product: D
   Version: D1  D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: diagnostic
  Severity: normal
  Priority: P2
 Component: Optlink
AssignedTo: nob...@puremagic.com
ReportedBy: mrmoc...@gmx.de


--- Comment #0 from Trass3r mrmoc...@gmx.de 2010-09-14 16:26:39 PDT ---
testc.c
===

int foo;

test.d
==

extern(C)
{
extern int foo;
}

void main()
{
foo = 1;
}


 dmc -c testc.c  dmd test.d testc.obj  test.exe
object.Error: Access Violation

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4856] opDispatch does not work with specified template parameters

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4856


Guillaume Benny guillaume.be...@sympatico.ca changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID


--- Comment #1 from Guillaume Benny guillaume.be...@sympatico.ca 2010-09-14 
17:44:47 PDT ---
Simen Kjaeraas found a solution:

http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.comgroup=digitalmars.Dartnum=117353

===
The correct way to do what you want is this: 

module foo; 

import std.stdio; 

struct test { 
 template opDispatch( string name ) { 
 void opDispatch( string other )( ) { 
 writeln( name, , , other ); 
 } 
 } 
} 

void main( ) { 
 test t; 
 t.foo!( Hey! )( ); 
} 
===

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4869] New: auto return + inheritance + modules = compiler crashes

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4869

   Summary: auto return + inheritance + modules = compiler crashes
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2010-09-14 19:13:28 PDT ---
The following code crashes both DMD 2.048 and 2.049 beta on Windows:

// Module a.d
class Base {
auto fun() { return 1; }
}

// Module b.d
import a;

class Derived : Base {}

// Command
dmd -c b.d


Any of the following will prevent this bug from being reproduced:

1.  Changing the return type of fun from auto to int.
2.  Passing both modules to DMD at once.
3.  Putting both classes in the same module.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4869] auto return + inheritance + modules = compiler crashes

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4869


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

 CC||clugd...@yahoo.com.au


--- Comment #1 from Don clugd...@yahoo.com.au 2010-09-14 20:52:39 PDT ---
Not a regression. This fails on 2.026 and later.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4870] New: Suffix for intptr_t literals

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4870

   Summary: Suffix for intptr_t literals
   Product: D
   Version: future
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: websites
AssignedTo: nob...@puremagic.com
ReportedBy: dfj1es...@sneakemail.com


--- Comment #0 from Sobirari Muhomori dfj1es...@sneakemail.com 2010-09-14 
21:03:03 PDT ---
It's a common practice to use intptr_t-typed negative values. It would be handy
to have a suffix for such literals in order to not confuse anyone with implicit
sign-extending integer conversions and not use a cast at the same time.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4869] auto return + inheritance + modules = compiler crashes(toctype.c)

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4869


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

Summary|auto return + inheritance + |auto return + inheritance +
   |modules = compiler crashes  |modules = compiler
   ||crashes(toctype.c)


--- Comment #2 from Don clugd...@yahoo.com.au 2010-09-14 21:02:06 PDT ---
The segfault should be turned into an ICE with this code: toctype.c, line 254
TypeFunction::toCtype()

if (varargs != 1)
t-Tflags |= TFfixed;
ctype = t;
+assert(next);
t-Tnext = next-toCtype();

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4871] New: compiler crash: dmd: mtype.c:875: void Type::check(): Assertion `tn-mod 4 || tn-mod 1' failed.

2010-09-14 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4871

   Summary: compiler crash: dmd: mtype.c:875: void Type::check():
Assertion `tn-mod  4 || tn-mod  1' failed.
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: minor
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: cru...@gmail.com


--- Comment #0 from AdamB cru...@gmail.com 2010-09-14 22:47:30 PDT ---
Running dmd v2.048 the compiler seems to crash on code like this:

  alias ubyte foo;
  alias const foo * const_fooP;

  void main()
  {
  }

The error is:

dmd: mtype.c:875: void Type::check(): Assertion `tn-mod  4 || tn-mod  1'
failed.
Aborted


I'm new to D so this might be invalid syntax but it shouldn't crash the
compiler.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---