[Issue 5596] Regression(2.052): Different template alias parameters to the same literal result in different template instances

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5596


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 CC||k.hara...@gmail.com


--- Comment #6 from Kenji Hara k.hara...@gmail.com 2011-07-19 23:06:32 PDT ---
This is same as issue 5046, and already fixed in D2.

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


[Issue 6353] New: No stacktraces on x86_64

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6353

   Summary: No stacktraces on x86_64
   Product: D
   Version: unspecified
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: druntime
AssignedTo: nob...@puremagic.com
ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis jmdavisp...@gmx.com 2011-07-20 00:46:20 
PDT ---
This program

void main()
{
assert(0);
}

prints this on x86_64:

core.exception.AssertError@w(3): Assertion failure



_All_ stack traces look like that on x86_64. For this one, if I were to compile
with -m32, I'd get this:

core.exception.AssertError@w(3): Assertion failure

./w(onAssertError+0x2e) [0x806111e]
./w(_d_assertm+0x16) [0x805f096]
./w() [0x805ca76]
./w(_Dmain+0xd) [0x805ca61]
./w(_D2rt6dmain24mainUiPPaZi7runMainMFZv+0x1a) [0x805f53e]
./w(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20) [0x805f1d8]
./w(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x32) [0x805f582]
./w(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20) [0x805f1d8]
./w(main+0x94) [0x805f184]
/usr/lib32/libc.so.6(__libc_start_main+0xf3) [0xf75aa233]


So, this is purely a 64-bit issue. But the lack of stacktraces on x86_64 is a
definite impedement to debugging, and it really needs to get fixed.

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


[Issue 6354] New: Optimizer bug on x86_64: Bitshift optimized out when foreach and scope(failure) are used

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6354

   Summary: Optimizer bug on x86_64: Bitshift optimized out when
foreach and scope(failure) are used
   Product: D
   Version: unspecified
  Platform: x86_64
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis jmdavisp...@gmx.com 2011-07-20 01:03:12 
PDT ---
Okay. This is a weird one, but it only happens on x86_64 when compiling with
-O, so presumably it's a bug in the optmizer for x86_64. This code

import std.stdio;

ushort swapEndian(ushort val)
{
return ((val  0xff00U)  8) |
   ((val  0x00ffU)  8);
}

void main()
{
foreach(j; 0 .. 2)
{
scope(failure) writefln(j: %s, j);

ushort left = 0xffU;
left = (ushort.sizeof - 1) * 8;
ushort right = 0xffU;

writefln(%s %s %s %s, swapEndian(left), right, swapEndian(right),
left);
assert(swapEndian(left) == right);
}
}

does this:

255 65280 255 65280
j: 0
core.exception.AssertError@q(25): Assertion failure



Thee writefln at the bottom can be removed, but it helps show what's going on,
since the correct output for this program would be

255 255 65280 65280
255 255 65280 65280

While the program does fail on the first iteration, removing the loop makes it
so that it succeeds, so the foreach somehow helps cause the bug. Removing the
scope(failure) also helps contribute, since removing _it_ gets rid of the bug.
However, it fails regardless of whether it's a scope(failure), scope(success),
or scope(exit). It also fails regardless of what's in the scope statement (e.g.
it fails with scope(failure) int i;). You can also get rid of swapEndian and
replace the call to it with its body and have the failure occur

assertleft  0xff00U)  8) | ((left  0x00ffU)  8)) == right);

so the function call isn't part of the problem (but it's easier to read with
swapEndian in there, so I left in there). I can narrow it down to this at it
still fails

void main()
{
foreach(j; 0 .. 2)
{
scope(failure) int i = 0;

ushort left = 0xffU;
left = (ushort.sizeof - 1) * 8;

assertleft  0xff00U)  8) | ((left  0x00ffU)  8)) == 0xffu);
}
}

However, sometimes, some combination of changes in between those two states
succeeds - probably depending on what the optimizer decides that it can
optimize out.

In any case, it seems that something is causing the optimizer to think that it
can optimize out the bitshifts. And it's something that's going to cause test
failures if the swapEndian stuff that I'm currently working on for Phobos gets
merged in, so it would be nice if it could be fixed soon.

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


[Issue 6347] Switch to posix.mak is not listed in changelog, and linux.mak is still in zip

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6347



--- Comment #2 from Alexander d...@metis.utfs.org 2011-07-20 02:03:53 PDT ---
okay, with posix.mak it works.

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


[Issue 6355] New: Template constructor cannot initialize non-mutable field

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6355

   Summary: Template constructor cannot initialize non-mutable
field
   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: k.hara...@gmail.com


--- Comment #0 from Kenji Hara k.hara...@gmail.com 2011-07-20 02:17:09 PDT ---
This is valid D2 code, but couldn't compile.


struct S
{
const int value;
this()(int n){ value = n; }
}
void main()
{
S s = S(10);
}

test.d(4): Error: can only initialize const member value inside constructor
test.d(8): Error: template instance test.S.__ctor!() error instantiating


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


[Issue 6355] Template constructor cannot initialize non-mutable field

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6355


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||patch


--- Comment #1 from Kenji Hara k.hara...@gmail.com 2011-07-20 03:04:48 PDT ---
https://github.com/D-Programming-Language/dmd/pull/266

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


[Issue 6310] Missing template instantiation traceback when an error happens in the template parameter of an alias.

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6310



--- Comment #3 from kenn...@gmail.com 2011-07-20 03:22:10 PDT ---
One more test case.

---
void f()() {}
@safe int g(alias key)() {
typeof(key(0)) k;   // line 3.
f();
return 0;
}
void main() {
g!((int x) {
auto y = x + 1;
return 0;
})();
}
---
x.d(3): Error: safe function 'g' cannot call system delegate '__dgliteral1'
---

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


[Issue 6356] New: Pure/nothrow/@safe-inference failed for a template function if it is instantiated without evaluating at the global scope

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6356

   Summary: Pure/nothrow/@safe-inference failed for a template
function if it is instantiated without evaluating at
the global scope
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-07-20 09:03:11 PDT ---
Test case:

--
int f6356()(int a) {
return a*a;
}
alias f6356!() g6356; // comment this out to eliminate the errors
pure nothrow @safe int i6356() {
return f6356(1);
}
--
x.d(6): Error: pure function 'i6356' cannot call impure function 'f6356'
x.d(6): Error: safe function 'i6356' cannot call system function 'f6356'
x.d(6): Error: f6356 is not nothrow
x.d(5): Error: function x.i6356 'i6356' is nothrow yet may throw
--

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


[Issue 4625] in operator for AAs in SafeD code

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4625


kenn...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||kenn...@gmail.com
 Resolution||FIXED


--- Comment #2 from kenn...@gmail.com 2011-07-20 09:34:21 PDT ---
Currently 'in' can be used in @safe function.

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


[Issue 6357] New: Almost all AA methods are not pure/nothrow/@safe

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6357

   Summary: Almost all AA methods are not pure/nothrow/@safe
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: druntime
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com
Depends on: 


--- Comment #0 from kenn...@gmail.com 2011-07-20 09:35:32 PDT ---
Test case:
-
@safe auto bug6357(int[int] x) {
auto k = x.keys;// error: not @safe
auto v = x.values;  // error: not @safe
auto bk = x.byKey;  // error: not @safe
auto bv = x.byValue;// error: not @safe
auto g = x.get(0, 1);   // error: not @safe
auto l = x.length;  // error: not @safe
foreach (va; x) {}  // error: not @safe
foreach (ke, va; x) {}  // error: not @safe
x.rehash;   // error: not @safe (as it should be?)
x[0] = 4;   // ok
auto i = x[0];  // ok
auto p = 0 in x;// ok
x.remove(0);// ok
}
-

They are not 'pure' and 'nothrow' as well

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


[Issue 6356] Pure/nothrow/@safe-inference failed for a template function if it is instantiated without evaluating at the global scope

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6356


kenn...@gmail.com changed:

   What|Removed |Added

   Platform|Other   |All
 OS/Version|Mac OS X|All
   Severity|normal  |major


--- Comment #1 from kenn...@gmail.com 2011-07-20 11:09:12 PDT ---
Raising severity because unaryFun and binaryFun are used in template
constraints or return types. This bug makes std.algorithm.equal not able to be
pure/nothrow/@safe, for example.

2nd test case:
-
bool f6356b()() {
return true;
}
void g6356b()() if (is(typeof(f6356b( {
f6356b();
}
void h6356b() pure nothrow @safe {
//f6356b();// -- uncomment to make it compile.
g6356b();
}
-
x.d(9): Error: pure function 'h6356b' cannot call impure function 'g6356b'
x.d(9): Error: safe function 'h6356b' cannot call system function 'g6356b'
x.d(9): Error: g6356b is not nothrow
x.d(7): Error: function x.h6356b 'h6356b' is nothrow yet may throw
-

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


[Issue 6358] New: ICE when using an member template (not a template instance) in an expression.

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6358

   Summary: ICE when using an member template (not a template
instance) in an expression.
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-07-20 14:15:47 PDT ---
Test case:
---
struct S6358 {
double peek(T)(int x) {
return 0;
}
}
void bug6358a() {
S6358 s;
cast(void) (s.peek is s);   // -- (a)
}
void bug6358b() {
S6358 s;
cast(void) (s.peek + s);// -- (b)
}
void bug6358c() {
S6358 s;
s.peek += 1;// -- (c)
}
---

The ICE in (a) happens at:

Expression *BinExp::typeCombine(Scope *sc)
{
Type *t1 = e1-type-toBasetype();
Type *t2 = e2-type-toBasetype();   // -- this line, e2-type == NULL

if (op == TOKmin || op == TOKadd)
{

The ICE in (b) happens at:

AggregateDeclaration *isAggregate(Type *t)
{
t = t-toBasetype();// -- this line, t == NULL
if (t-ty == Tclass)
{


The ICE in (c) happens at:

int CallExp::isLvalue()
{
//if (type-toBasetype()-ty == Tstruct)
//  return 1;
Type *tb = e1-type-toBasetype();   // -- the line, e1-type == NULL

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


[Issue 6359] New: Pure/@safe-inference should not be affected by __traits(compiles)

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6359

   Summary: Pure/@safe-inference should not be affected by
__traits(compiles)
   Product: D
   Version: D2
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kenn...@gmail.com


--- Comment #0 from kenn...@gmail.com 2011-07-20 14:35:16 PDT ---
Test case:

--
@system void f6359() {}
pure void bug6359()() {
static if (__traits(compiles, f6359())) {  // -- this won't compile
static assert(0);
}
}
void g6359() pure nothrow @safe {
bug6359();
}
--
x.d(9): Error: safe function 'g6359' cannot call system function 'bug6359'
--

The stuff inside `__traits(compiles, )` won't affect the purity/safety of the
program. Therefore, in the inference, the failed semantic to the @system
function `f6359` should not make `bug6359()` not able to be @safe.

The same happens if the annotation of `bug6359` is changed to @safe, which now
it is no longer inferable as pure.

nothrow is not affected.

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


[Issue 1471] Linker error on template function. Error 42: Symbol Undefined ...

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1471


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #5 from Walter Bright bugzi...@digitalmars.com 2011-07-20 
15:44:48 PDT ---
https://github.com/D-Programming-Language/dmd/commit/be6a395ae8b36f2b62788ed00dddc502902c4c5f

https://github.com/D-Programming-Language/dmd/commit/49375940e312d17fc975ab2f028df99f3e5eda1b

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


[Issue 1471] Linker error on template function. Error 42: Symbol Undefined ...

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1471



--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2011-07-20 
15:48:06 PDT ---
https://github.com/D-Programming-Language/dmd/commit/be6a395ae8b36f2b62788ed00dddc502902c4c5f

https://github.com/D-Programming-Language/dmd/commit/49375940e312d17fc975ab2f028df99f3e5eda1b

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


[Issue 6281] [CTFE] A null pointer '!is null' returns 'true'.

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6281


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

   What|Removed |Added

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


--- Comment #2 from Don clugd...@yahoo.com.au 2011-07-20 16:23:32 PDT ---
(In reply to comment #0)
 Test case:
 
 
 static assert(!{
 auto p = null;
 return p !is null;
 }());
 
 x.d(1): Error: static assert  (!true) is false
 
 
 The problem is the strange statement 'cmp ^= -1' in
 https://github.com/D-Programming-Language/dmd/blob/master/src/interpret.c#L2338.
 When two pointers are both null, 'cmp' will be 1, and 'cmp ^ -1' is -2 which 
 is
 also true.

IIRC that was copied from Equals() in constfold.c. The bug probably exists
there as well.

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


[Issue 6024] Windows 2000 SP4 is not supported any more? And what is still supported?

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6024


twk twkr...@gmail.com changed:

   What|Removed |Added

 CC||twkr...@gmail.com


--- Comment #10 from twk twkr...@gmail.com 2011-07-20 17:29:50 PDT ---
I would like to have Windows 2000 supported,
but I will understand if you decide not to support Windows 2000.

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


[Issue 6135] Thread/GC interaction bug on OS X

2011-07-20 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=6135


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


--- Comment #5 from klickverbot c...@klickverbot.at 2011-07-20 21:59:06 PDT 
---
Closing, again, as 2.054 has been released in the meantime.

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