[Issue 17332] New: optilink or dmd bug

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17332

  Issue ID: 17332
   Summary: optilink or dmd bug
   Product: D
   Version: D2
  Hardware: x86_64
OS: Windows
Status: NEW
  Severity: critical
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: phreon...@gmail.com

Major optilink bugs, blocker. Code is long but demonstrates the issue. Compiles
with ldc.

The source is large so I uploaded it

https://ufile.io/odaee

or

https://files.fm/u/frmks29t




OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset 481D2H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main12cApplication15ForegroundColorMFC4main11cSolidColorZv (void
main.cApplication.ForegroundColor(main.cSolidColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset 49058H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main12cApplication15BackgroundColorMFC4main11cSolidColorZv (void
main.cApplication.BackgroundColor(main.cSolidColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset 89BFFH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main9cTextItem5ColorMFC4main11cSolidColorZv (void
main.cTextItem.Color(main.cSolidColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset A6CBEH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main11cSolidColor3RGBMFC4main9cRGBColorZv (void
main.cSolidColor.RGB(main.cRGBColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset A7B4BH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main11cSolidColor4GrayMFC4main10cGrayColorZv (void
main.cSolidColor.Gray(main.cGrayColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset A89C6H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main11cSolidColor4CMYKMFC4main10cCMYKColorZv (void
main.cSolidColor.CMYK(main.cCMYKColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset A9421H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main11cSolidColor3LabMFC4main9cLabColorZv (void
main.cSolidColor.Lab(main.cLabColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset AA29FH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main11cSolidColor3HSBMFC4main9cHSBColorZv (void
main.cSolidColor.HSB(main.cHSBColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset E2D37H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main8cChannel5ColorMFC4main11cSolidColorZv (void
main.cChannel.Color(main.cSolidColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset C1983H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main24cExportOptionsSaveForWeb10MatteColorMFC4main9cRGBColorZv (void
main.cExportOptionsSaveForWeb.MatteColor(main.cRGBColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset D33B4H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main20cPresentationOptions14PDFFileOptionsMFC4main15cPDFSaveOptionsZv (void
main.cPresentationOptions.PDFFileOptions(main.cPDFSaveOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset D8777H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main15cGalleryOptions13BannerOptionsMFC4main21cGalleryBannerOptionsZv (void
main.cGalleryOptions.BannerOptions(main.cGalleryBannerOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset D9617H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main15cGalleryOptions13ImagesOptionsMFC4main21cGalleryImagesOptionsZv (void
main.cGalleryOptions.ImagesOptions(main.cGalleryImagesOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset DA4C2H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main15cGalleryOptions16ThumbnailOptionsMFC4main24cGalleryThumbnailOptionsZv
(void main.cGalleryOptions.ThumbnailOptions(main.cGalleryThumbnailOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset DB36FH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main15cGalleryOptions18CustomColorOptionsMFC4main26cGalleryCustomColorOptionsZv
(void main.cGalleryOptions.CustomColorOptions(main.cGalleryCustomColorOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset DC219H Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main15cGalleryOptions15SecurityOptionsMFC4main23cGallerySecurityOptionsZv
(void main.cGalleryOptions.SecurityOptions(main.cGallerySecurityOptions))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset F078FH Record Type 00C3 
 Error 1: Previous Definition Different :
_D4main26cGalleryCustomColorOptions15BackgroundColorMFC4main9cRGBColorZv (void
main.cGalleryCustomColorOptions.BackgroundColor(main.cRGBColor))
Win32\Debug DMD\ConsoleApp1.obj(ConsoleApp1)  Offset F163CH Record Type 00C3 
 Error 1: Previous Definition Different :

[Issue 17331] appender can't be used for initialization twice

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17331

Heromyth  changed:

   What|Removed |Added

Summary|appender can't be use for   |appender can't be used for
   |initialization  |initialization twice

--


[Issue 17331] New: appender can't be use for initialization

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17331

  Issue ID: 17331
   Summary: appender can't be use for initialization
   Product: D
   Version: D2
  Hardware: x86
OS: Windows
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: bitwo...@qq.com

Compiler: DMD32 D Compiler v2.074.0
OS: Windows, Ubuntu

Here is my test code.

import std.stdio;
import std.array;

struct PackageHandler
{
private auto buffer = appender!(ubyte[])();  // The bug is here
// private Appender!(ubyte[]) buffer;  // It's ok.

void test()
{
assert(buffer.data.length == 0);  // for test
}

void append(ubyte[] data)
{
buffer ~= data;
}

void reset()
{
buffer.clear();
}
}

class AppenderTester
{
private PackageHandler handler;

this()
{
handler.test();
}

void append()
{
handler.append([11, 12, 13]);
}

void clear()
{
handler.reset();
}
}

void main()
{
AppenderTester tester01 = new AppenderTester();
tester01.append();
// tester01.clear();

AppenderTester tester02 = new AppenderTester();
}

--


[Issue 7102] std.numeric.gcd with BigInts too

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102

--- Comment #5 from hst...@quickfur.ath.cx ---
To make matters worse, std.numeric.gcd has no sig constraints, so once you
import std.numeric.gcd, you cannot even define a BigInt specialization of gcd
in your own code without causing a conflict in the overload set. Unless you do
a static import or any of the other ways of working around the symbol conflict.

--


[Issue 7102] std.numeric.gcd with BigInts too

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7102

hst...@quickfur.ath.cx changed:

   What|Removed |Added

 CC||hst...@quickfur.ath.cx

--


[Issue 17329] File.remove() has problems with long filenames (>128 bytes)

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17329

--- Comment #2 from Rainer Koschnick  ---
Thanks for the hint, but it doesn't change anything.

Error:
\\?\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.cbz:
The system cannot find the file specified.

Neither does...

Error:
.\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.cbz:
The system cannot find the file specified.

Nor using a complete path...

Error:
D:\_Development_\D\cbc\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.cbz:
The system cannot find the file specified.

--


[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309

--- Comment #4 from ag0ae...@gmail.com ---
(In reply to Walter Bright from comment #3)
> I think that trouble here is that attribute inference is not done until the
> template is instantiated. But the compiler does not instantiate a template
> until it matches a template, and
> 
> this(Range)(Range s)
> 
> does not match for constructing an immutable. I don't see a way out of this
> chicken-and-egg problem.
> 
> I'm going to mark this as invalid.

1) That's a major bummer.

2) It means that Russel's issue is a phobos regression. I've filed it
separately as issue 17330.

--


[Issue 17330] New: [REG 2.072] BigInt's constructor used to be pure

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17330

  Issue ID: 17330
   Summary: [REG 2.072] BigInt's constructor used to be pure
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: ag0ae...@gmail.com

Found by Russel Winder who posted to D.learn:
http://forum.dlang.org/post/mailman.1458.1491584811.31550.digitalmars-d-le...@puremagic.com

This used to work, and it should be made to work again:


void main()
{
import std.bigint: BigInt;
auto b = immutable BigInt("123");
}


Fails compilation since 2.072.0. Regression was introduced by
.

The issue is that purity cannot be inferred for the constructor. It used to be
explicitly marked `pure` when it wasn't a template.

I've previously filed this as a compiler bug, thinking that a templated
constructor should infer `pure`. That issue has been closed as WONTFIX. See
issue 17309.

I'm not sure if this can be fixed satisfactorily. So this may end up as WONTFIX
as well. But that would be quite disappointing.

--


[Issue 8687] Variadic templates do not work properly with default arguments

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8687

Jonathan M Davis  changed:

   What|Removed |Added

 CC||issues.dl...@jmdavisprog.co
   ||m

--- Comment #4 from Jonathan M Davis  ---
It looks like the status quo right now (with the development version of dmd
2.075) is that default arguments work with variadic templates if the template
is explicitly instantiated but not if IFTI is used. So,

-
void foo(T...)(T args, string file = __FILE__) { }

void main()
{
foo();
}
-

won't compile, but

-
void foo(T...)(T args, string file = __FILE__) { }

void main()
{
foo!int(42);
}
-

will. So, it looks like this is probably now purely an IFTI issue. And
presumably, IFTI could be made to just assume that the default arguments are
always used (since it has no way of differentiating between explicit arguments
for those parameters and variadic arguments that have the same type, and anyone
who wants to provid explicit arguments can always explicitly instantiate the
template, which even works right now). That _seems_ like it would be
straightforward, but I'm not at all familiar with how IFTI is implemented in
the compiler.

Regardless, having it fixed so that the default arguments compile when IFTI is
used would have a significant impact on stuff like std.experimental.logger,
which currently has __FILE__, __LINE__, __FUNCTION__, __PRETTY_FUNCTION__, and
__MODULE__ as default template arguments, which results in a function template
being instantiated for every log call.

--


[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309

Walter Bright  changed:

   What|Removed |Added

 Resolution|FIXED   |WONTFIX

--


[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Walter Bright  ---
I think that trouble here is that attribute inference is not done until the
template is instantiated. But the compiler does not instantiate a template
until it matches a template, and

this(Range)(Range s)

does not match for constructing an immutable. I don't see a way out of this
chicken-and-egg problem.

I'm going to mark this as invalid.

--


[Issue 17309] [REG 2.073.2] constructor template doesn't infer `pure`

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17309

--- Comment #2 from Walter Bright  ---
(In reply to Walter Bright from comment #1)
> It also compiles with dmd 2.070, didn't check other versions.

I don't know what I did there. I can't get it to compile with any dmd versions
I tried, so I don't think this is a regression.

--


[Issue 12115] Segfault in FormatSpec.fillUp

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12115

Daniel Čejchan  changed:

   What|Removed |Added

 CC||czda...@gmail.com

--


[Issue 17321] Example code for std.stdio.File fails to compile

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17321

Walter Bright  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--- Comment #2 from Walter Bright  ---
I'm going to abandon this.

--


[Issue 17326] 2.072 gc changes broke 32 bit Windows DLLs

2017-04-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17326

--- Comment #3 from Walter Bright  ---
The problem is I cannot get the DLL test cases into the autotester test suite,
which is why DLL support regularly breaks.

--