[Issue 4828] New: ICE w/ non-boolean dot expression sth.template_instance in static if

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

   Summary: ICE w/ non-boolean dot expression
sth.template_instance in static if
   Product: D
   Version: D2
  Platform: All
OS/Version: All
Status: NEW
  Keywords: ice-on-invalid-code
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: rsi...@gmail.com


--- Comment #0 from Shin Fujishiro rsi...@gmail.com 2010-09-05 23:25:53 PDT 
---
Using an syntax `something.template_instance` in static-if triggers an
assertion at expression.c(817).

struct S
{
template P() {}
alias P!() p;
}
static if (S.p) {}  // ICE

% dmd -o- -c test
Assertion failed: (pr != PREC_zero), function expToCBuffer, file expression.c,
line 817.


Assertion failure did not occur before svn r629.

% dmd-r628 -o- -c test
test.d(6): Error: expression S dotexp P!() is not constant or does not evaluate
to a bool


-- 
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-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4820


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

   What|Removed |Added

 CC||clugd...@yahoo.com.au
Summary|Regressions in DStress  |Regression(1.058, 2.044) in
   |caused by changeset 452 |DStress caused by changeset
   ||452
   Severity|normal  |regression


-- 
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-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4820



--- Comment #1 from Don clugd...@yahoo.com.au 2010-09-06 00:44:52 PDT ---
Thanks for the superb bug report!
Reduced test case shows it's nothing to do with lazy:

void nextis(void delegate() dg = {}) {}

void main() {
nextis();
}

This is failing because function/delegate literals cannot be inlined. Prior to
svn 452, that wasn't being checked in the special case where they were default
parameters. Until bug 2935 was fixed, default values were created in the same
scope as the function declaration. That was a disaster for structs, but might
be OK for function literals -- not sure. Here's an example which used to
compile, but now fails, which never used global scope.

void main() {
   int x = 27;
   int nextis(int delegate() dg = { return x; }) { return dg(); }
   ++x;
   assert(nextis() == 28);
}

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


[Issue 4828] ICE w/ non-boolean dot expression sth.template_instance in static if

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


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

   What|Removed |Added

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


--- Comment #2 from Don clugd...@yahoo.com.au 2010-09-06 04:19:52 PDT ---
Another regression from the same svn commit, that hits the same assert:

static assert(!is(typeof(Object.tupleof[2000]=0)));
---
precedence not defined for token 'tuple'
assert expression.c(816) precedence[e-op] != PREC_zero

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


[Issue 4829] New: Linux build fails

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

   Summary: Linux build fails
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: arkang...@gmail.com


--- Comment #0 from Pedro Ferreira arkang...@gmail.com 2010-09-06 08:00:06 
PDT ---
Created an attachment (id=749)
Patch to fix

You forgot to add -lm to the makefile to link in the math library. Link fails
due to unresolved references to pow, floor, etc. Unsure if DMD1 fails.

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


[Issue 4830] New: mtype.c:879: void Type::check(): Assertion `tn-mod == 4' failed

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

   Summary: mtype.c:879: void Type::check(): Assertion `tn-mod ==
4' failed
   Product: D
   Version: D2
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer ellery-newco...@utulsa.edu 2010-09-06 
11:41:29 PDT ---
the code:

alias immutable string[] strings;
strings a = [ ];
strings b = [ ];

dmd 2.048

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


[Issue 4830] Regression(2.038) ICE mtype.c:879: void Type::check(): Assertion `tn-mod == 4' failed

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


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

   What|Removed |Added

 CC||clugd...@yahoo.com.au
Summary|mtype.c:879: void   |Regression(2.038) ICE
   |Type::check(): Assertion|mtype.c:879: void
   |`tn-mod == 4' failed   |Type::check(): Assertion
   ||`tn-mod == 4' failed
 OS/Version|Linux   |All
   Severity|normal  |regression


--- Comment #1 from Don clugd...@yahoo.com.au 2010-09-06 12:00:01 PDT ---
And it's a regression. Worked in 2.037, ICE in 2.038.

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


[Issue 4831] New: Optlink failed to parse PATH env variable with -g option

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

   Summary: Optlink failed to parse PATH env variable with -g
option
   Product: D
   Version: D2
  Platform: All
OS/Version: Windows
Status: NEW
  Severity: blocker
  Priority: P2
 Component: Optlink
AssignedTo: nob...@puremagic.com
ReportedBy: flamaros.xav...@gmail.com


--- Comment #0 from Xavier Bigand flamaros.xav...@gmail.com 2010-09-06 
13:03:39 PDT ---
Here is the error :

OPTLINK : Error 118: Filename Expected
Path=D:\Softs\D\dmd2\windows\bin;C:\Program Files\Microsoft
SDKs\Windows\v6.0A\\bin;C:\Program Files\NVIDIA
Corporation\PhysX\Common;D:\Softs\VTune\CGGlbCache;D:\Softs\VTune\Analyzer\Bin;D:\Softs\VTune\Shared\Bin;D:\Softs\Python26\Lib\site-packages\PyQt4\bin;D:\Softs\Perl\site\bin;D:\Softs\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Fichiers communs\Roxio Shared\DLLShared\;C:\Program Files\Fichiers
communs\Roxio
Shared\9.0\DLLShared\;D:\Softs\SDKs\Wii\NDEV\bin;D:\Softs\Microsoft Visual
Studio 8\VC\bin;D:\Softs\doxygen\bin;D:\Softs\Graphviz2.24\bin;c:\Program
Files\Microsoft SQL
Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;D:\Softs\TortoiseGit\bin;D:\Softs\QuickTime\QTSystem\;D:\Softs\TortoiseSVN\bin;D:\Softs\gDEBugger\gDEBugger\;D:\Softs\D\dmd\windows\bin;D:\Softs\D\dmd2\windows\bin;D:\Softs\D\dm\bin;D:\Projects\Tetraedge\Trunk\TeEngine_3\Tools\Libs\Qt;D:\Softs\FileVerifier++\;D:\Softs\SDKs\Android\android-sdk-windows\tools;D:\Softs\apache-ant\bin

It seems D:\Softs\FileVerifier++\ with '+' character reveal the issue.

Here it's my original discussion :
http://www.dsource.org/forums/viewtopic.php?t=5585

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


[Issue 4832] New: Functions external to class break immutability

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

   Summary: Functions external to class break immutability
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic andrej.mitrov...@gmail.com 2010-09-06 
13:37:14 PDT ---
Code:

import std.stdio : writeln;

void foo(ref int x)
{
x = 10;
}

class Bar
{
immutable int x;

this()
{
x = 5;
}

void printMe()
{
writeln(this.x);
}

void change()
{
//~ this.x = 20;// illegal, errors out
}
}

void main()
{
Bar bar = new Bar;
bar.printMe();  // prints 5

//~ bar.x = 10;  // illegal, errors out

foo(bar.x); // no error!
bar.printMe();  // prints 10
}

The commented out code would error out at compile time, which is expected. But
the function bar() is breaking immutability of x.

A relevant bug is bug 4416 , and my comment:
http://d.puremagic.com/issues/show_bug.cgi?id=4416#c1

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


[Issue 4832] Functions external to class break immutability

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



--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2010-09-06 
13:37:55 PDT ---
Sorry, I meant the function foo, not bar.

(In reply to comment #0)
 Code:
 
 import std.stdio : writeln;
 
 void foo(ref int x)
 {
 x = 10;
 }
 
 class Bar
 {
 immutable int x;
 
 this()
 {
 x = 5;
 }
 
 void printMe()
 {
 writeln(this.x);
 }
 
 void change()
 {
 //~ this.x = 20;// illegal, errors out
 }
 }
 
 void main()
 {
 Bar bar = new Bar;
 bar.printMe();  // prints 5
 
 //~ bar.x = 10;  // illegal, errors out
 
 foo(bar.x); // no error!
 bar.printMe();  // prints 10
 }
 
 The commented out code would error out at compile time, which is expected. But
 the function bar() is breaking immutability of x.
 
 A relevant bug is bug 4416 , and my comment:
 http://d.puremagic.com/issues/show_bug.cgi?id=4416#c1

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


[Issue 3996] Regression(2.041) ICE(glue.c) Passing struct as AA template parameter (Algebraic with struct)

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


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

   What|Removed |Added

   Keywords||patch


--- Comment #4 from Don clugd...@yahoo.com.au 2010-09-06 14:01:17 PDT ---
This turns out to be simple. When there's an error in the AA parameters, it
should not continue to instantiate the template.
There's no error declaration, so return a struct of type TError. Not sure if
it's OK to give it no name.
(Would also be possible to return NULL in this case, but then everything that
calls it would need to be changed, to prevent segfaults).

PATCH(mtype.c): Line 3966

StructDeclaration *TypeAArray::getImpl()
{
// Do it lazily
if (!impl)
{
Type *index = this-index;
Type *next = this-next;
if (index-reliesOnTident() || next-reliesOnTident())
{
error(loc, cannot create associative array %s, toChars());
index = terror;
next = terror;
+StructDeclaration *s = new StructDeclaration(0, NULL);
+s-type = terror;
+return s;
}

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


[Issue 4833] New: dmd -od doesn't make it to optlink's command line for map files

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

   Summary: dmd -od doesn't make it to optlink's command line for
map files
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bra...@puremagic.com


--- Comment #0 from Brad Roberts bra...@puremagic.com 2010-09-06 15:53:28 PDT 
---
Despite specifying a directory for output, the map file is generated in the
current directory.

example, test.d:
void main() {}

$ mkdir output
$ dmd -odoutput -ofoutput\\test.exe test.d
   from -v: link.exe output\test,output\test.exe,,user32+kernel32/noi;
$ ls -lR
.:
total 5
drwxr-xr-x+ 1 braddr None0 2010-09-06 15:49 output
-rw-r--r--  1 braddr None   15 2010-09-06 15:48 test.d
-rwxr-xr-x  1 braddr None 2573 2010-09-06 15:49 test.map

./output:
total 101
-rwxr-xr-x 1 braddr None 101404 2010-09-06 15:49 test.exe
-rwxr-xr-x 1 braddr None338 2010-09-06 15:49 test.obj

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


[Issue 4834] New: Implicit sharing via delegates in std.concurrency

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

   Summary: Implicit sharing via delegates in std.concurrency
   Product: D
   Version: D2
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha dsim...@yahoo.com 2010-09-06 19:26:07 PDT ---
The following code compiles and should not, because it allows implicit sharing
of data between threads in the supposedly safe std.concurrency:

import std.concurrency;

void runDelegate(void delegate() dg) {
dg();
}

class Foo {
uint num;

void incNum() {
num++;
}
}

void main() {
auto foo = new Foo;
spawn(runDelegate, foo.incNum);
}

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