[Issue 3045] New: Can't use ref with foreach on tuple

2009-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3045

   Summary: Can't use ref with foreach on tuple
   Product: D
   Version: 2.030
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: s...@invisibleduck.org


This code should compile:

void fn(T...)( ref T args )
{
foreach( ref e; args )
e = e.init;
}

void main()
{
int x, y;
fn( x, y );
}

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


[Issue 3044] New: Bus error compiling the following code

2009-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3044

   Summary: Bus error compiling the following code
   Product: D
   Version: 2.030
  Platform: Other
OS/Version: Mac OS X
Status: NEW
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: s...@invisibleduck.org


import std.typecons;

void fn(T)( T val )
{
T* tmp = new T;
}

void main()
{
fn( tuple(5) );
}

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


[Issue 3043] New: Template symbol arg cannot be demangled

2009-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3043

   Summary: Template symbol arg cannot be demangled
   Product: D
   Version: 2.030
  Platform: All
OS/Version: All
Status: NEW
  Keywords: patch, spec
  Severity: minor
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: rsi...@gmail.com


Created an attachment (id=388)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=388)
Patch (DMD 2.030)

=== Problem ===

Under the current spec, a template symbol argument is mangled to an LName:

TemplateArg:
T Type  // type argument
V Type Value// value argument
S LName // symbol argument

LName:
Number Name

This rule is troublesome for demangling. When Name is a QualifiedName (e.g.
template symbol), which starts with a Number, then there will be contiguous
Numbers in a mangled argument: "S Number Number Name Number Name ...". A
demangler will not be able to demangle such input correctly.

For example, this code

module test;
struct Temp(alias a) {}
template sym() {}
pragma(msg, Temp!(sym).mangleof);

prints "4test20__T4TempS94test3symZ4Temp". Here sym is mangled to
"S94test3sym"; the Number is "9" and the Name is "4test3sym". But a demangler
will recognize the Number and the Name as "94" and "test3sym", respectively.


=== Proposal ===

A template symbol argument may be
 (a) template declaration, template instance, template mixin,
 package, module,
 (b) variable or function.
(a) is mangled to a QualifiedName and (b) is mangled to a MangledName. These
two groups should be treated differently.

My proposal is this:

TemplateArg:
S TemplateSymbolArg

TemplateSymbolArg:
QualifiedName   // (a) qualified name
M LName // (b) mangled var/func name (_D, _Z, etc.)

This grammar does not generate contiguous Numbers. The prefix "M" is necessary
to avoid a same-mangled-name collision between QualifiedName and LName.

The attached patch modifies DMD 2.030 so that template symbol argument is
mangled with this rule.

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


[Issue 3034] Template instance name wrongly mangled as LName

2009-06-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3034


Shin Fujishiro  changed:

   What|Removed |Added

 Attachment #384 is|0   |1
   obsolete||




--- Comment #1 from Shin Fujishiro   2009-06-01 03:07:57 PDT 
---
Created an attachment (id=387)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=387)
Fix the problem (DMD 2.030)

I forgot to deal with TemplateMixin. It should be mangled as LName.

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