[Issue 3165] New: What kind of integer division does D use?

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3165

   Summary: What kind of integer division does D use?
   Product: D
   Version: unspecified
  Platform: All
   URL: http://www.digitalmars.com/d/2.0/expression.html#MulEx
pression
OS/Version: All
Status: NEW
  Keywords: spec
  Severity: normal
  Priority: P2
 Component: www.digitalmars.com
AssignedTo: nob...@puremagic.com
ReportedBy: m.helvenste...@gmail.com


Specify what kind of integer division D uses. The description is ambiguous when
one or both operands of / are negative. So, in other words, what does D return
from:

 3 /  2
 3 / -2
-3 /  2
-3 / -2

Such information should be part of the language specification.

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


[Issue 3166] New: positive - non-negative in modulo operator description

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3166

   Summary: positive - non-negative in modulo operator
description
   Product: D
   Version: unspecified
  Platform: All
   URL: http://www.digitalmars.com/d/2.0/expression.html#MulEx
pression
OS/Version: All
Status: NEW
  Keywords: spec
  Severity: normal
  Priority: P2
 Component: www.digitalmars.com
AssignedTo: nob...@puremagic.com
ReportedBy: m.helvenste...@gmail.com


For integral operands of the % operator, the sign of the result is
positive if the operands are positive, otherwise the sign of the result is
implementation defined.

should read

For integral operands of the % operator, the result is non-negative if the
operands are non-negative. Otherwise, the sign of the result is implementation
defined.

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


[Issue 2716] Confusion of auto and scope as the class attribute

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2716





--- Comment #6 from Christian Kamm kamm-removet...@incasoftware.de  
2009-07-12 08:23:17 PDT ---
Created an attachment (id=421)
 -- (http://d.puremagic.com/issues/attachment.cgi?id=421)
Do not consider auto to mean scope.

This is a patch against LDC's DMDFE. It removes the remaining instances of auto
meaning scope and makes 'auto class C { ... }' and 'auto C c;' an 'Error:
storage class has no effect: auto'. See also bug 3118 .

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


[Issue 3168] New: Declaring structs as incomplete types no longer works

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3168

   Summary: Declaring structs as incomplete types no longer works
   Product: D
   Version: 1.046
  Platform: All
OS/Version: All
Status: NEW
  Severity: regression
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: nfx...@gmail.com


In dmd 1.045, you used to be able to declare structs like this:


struct FT_RasterRec;


This no longer works with dmd 1.046.
The error message is:
test.d(1): Error: struct jk.FT_RasterRec has forward references

Declaring structs like this is often done in C to define incomplete types, and
is especially useful when porting C headers. Also, the new behavior in dmd
1.046 breaks old code.

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


[Issue 3024] Array slicing allows returning an escaping reference to a local stack variable

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3024


Matti Niemenmaa matti.niemenmaa+dbugzi...@iki.fi changed:

   What|Removed |Added

   Platform|x86 |All
Version|2.028   |1.045
Summary|array slicing bypass the|Array slicing allows
   |stack var escape check  |returning an escaping
   ||reference to a local stack
   ||variable
 OS/Version|Windows |All




--- Comment #2 from Matti Niemenmaa matti.niemenmaa+dbugzi...@iki.fi  
2009-07-12 08:53:14 PDT ---
Also affects 1.0.

It's true that the specs don't mention it but it's a bit inconsistent that both
the pointer and scope object cases are detected while the case of array slicing
isn't. Of the following, currently only the first three result in a compile
error:

int*   pointer() { int x;  return x;   }
Object object()  { scope Object x; return  x;   }
int[]  array()   { int[1] x;   return  x;   }
int[]  slice()   { int[1] x;   return  x[]; }

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


[Issue 3167] Passing result of a function call as ref argument no longer works

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3167


Christian Kamm kamm-removet...@incasoftware.de changed:

   What|Removed |Added

 CC||kamm-removet...@incasoftwar
   ||e.de




--- Comment #3 from Christian Kamm kamm-removet...@incasoftware.de  
2009-07-12 12:35:26 PDT ---
I'm fairly sure this was by design (bug 2621) in D 2.026, but I don't think it
was expected to seep through to D1.

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


[Issue 3165] What kind of integer division does D use?

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3165





--- Comment #1 from Michiel Helvensteijn m.helvenste...@gmail.com  2009-07-12 
14:11:52 PDT ---
I've ran the following test:

--
import std.stdio;

int main() {
writefln(8/3);
writefln(8/(-3));
writefln((-8)/3);
writefln((-8)/(-3));
writefln(8%3);
writefln(8%(-3));
writefln((-8)%3);
writefln((-8)%(-3));

return 0;
}
--

outputs the following

--
2
-2
-2
2
2
2
-2
-2
--

So DMD uses truncated division. The quotient rounds towards zero and the
remainder has the same sign as the dividend.

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


[Issue 1943] Templates can't take function pointer parameters

2009-07-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1943


Daniel Keep daniel.keep+d.puremagic@gmail.com changed:

   What|Removed |Added

   Keywords||spec
 CC||daniel.keep+d.puremagic.com
   ||@gmail.com




--- Comment #1 from Daniel Keep daniel.keep+d.puremagic@gmail.com  
2009-07-12 21:55:06 PDT ---
This has just cropped up on IRC.  Either the compiler should be fixed to match
the spec, or the spec should be changed to match the compiler's behaviour.

The simplest thing to do would be to change to spec to indicate that only
strings, ints and floats are allowed as value parameters.

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