[Issue 22806] cppmangle: Complex real mangled incorrectly

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22806

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibuclaw created dlang/dmd pull request #13702 "fix Issue 22806 - cppmangle:
Complex real mangled incorrectly" fixing this issue:

- fix Issue 22806 - cppmangle: Complex real mangled incorrectly

https://github.com/dlang/dmd/pull/13702

--


[Issue 22810] New: [REG 2.088] FAIL: runnable/test15.d on BigEndian targets

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22810

  Issue ID: 22810
   Summary: [REG 2.088] FAIL: runnable/test15.d on BigEndian
targets
   Product: D
   Version: D2
  Hardware: PowerPC
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

Caused by https://github.com/dlang/dmd/pull/10055

Because this statement is false.
---
0xDEADBEEF & 1 is 1.
---

--


[Issue 22810] [REG 2.088] FAIL: runnable/test15.d on BigEndian targets

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22810

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibuclaw created dlang/dmd pull request #13703 "fix Issue 22810 - [REG 2.088]
FAIL: runnable/test15.d on BigEndian targets" fixing this issue:

- fix Issue 22810 - [REG 2.088] FAIL: runnable/test15.d on BigEndian targets

https://github.com/dlang/dmd/pull/13703

--


[Issue 22806] cppmangle: Complex real mangled incorrectly

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22806

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13702 "fix Issue 22806 - cppmangle: Complex real
mangled incorrectly" was merged into master:

- 975801610b7f3f054b0c881d1dd330175b2f02d9 by Iain Buclaw:
  fix Issue 22806 - cppmangle: Complex real mangled incorrectly

https://github.com/dlang/dmd/pull/13702

--


[Issue 22804] [REG 2.099] compiling mutliple files without linking produces broken object files

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22804

Luís Ferreira  changed:

   What|Removed |Added

 CC||cont...@lsferreira.net

--


[Issue 22804] [REG 2.099] compiling multiple files without linking produces broken object files

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22804

Luís Ferreira  changed:

   What|Removed |Added

Summary|[REG 2.099] compiling   |[REG 2.099] compiling
   |mutliple files without  |multiple files without
   |linking produces broken |linking produces broken
   |object files|object files

--


[Issue 22810] [REG 2.088] FAIL: runnable/test15.d on BigEndian targets

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22810

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13703 "fix Issue 22810 - [REG 2.088] FAIL:
runnable/test15.d on BigEndian targets" was merged into master:

- 417b9fc75fc40b98897d93b806e31193f6fc1601 by Iain Buclaw:
  fix Issue 22810 - [REG 2.088] FAIL: runnable/test15.d on BigEndian targets

https://github.com/dlang/dmd/pull/13703

--


[Issue 22804] [REG 2.099] compiling multiple files without linking produces broken object files

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22804

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ljmf00 created dlang/dmd pull request #13704 "Fix issue 22804: multiple object
files without linking produces broken files" fixing this issue:

- Fix issue 22804: multiple object files without linking produces broken files

  Signed-off-by: Luís Ferreira 

https://github.com/dlang/dmd/pull/13704

--


[Issue 22804] [REG 2.099] compiling multiple files without linking produces broken object files

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22804

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13704 "Fix issue 22804: multiple object files without
linking produces broken files" was merged into stable:

- 7471cce04d21a26609bffeb418de272661d266ed by Luís Ferreira:
  Fix issue 22804: multiple object files without linking produces broken files

  Signed-off-by: Luís Ferreira 

https://github.com/dlang/dmd/pull/13704

--


[Issue 18594] X is not an lvalue should have a better error message

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18594

du...@neet.fi changed:

   What|Removed |Added

 CC||du...@neet.fi

--- Comment #6 from du...@neet.fi ---
the same error message is given when taking the address of a non-lvalue, but
"cannot be modified" doesn't necessarily apply there (and can be confusing)

// Error: `a[0..2]` is not an lvalue and cannot be modified
ubyte[2] a;
const void* p1 = &a[0..2];

// Error: cannot modify constant `1`
const void* p2 = &1;

for these, the message should rather say something like "cannot have its
address taken"

--


[Issue 22811] New: use of destructor is hidden by subclass

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22811

  Issue ID: 22811
   Summary: use of destructor is hidden by subclass
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

The following code current does not compile:

extern(C++):
class A
{
~this();
}
class B : A
{
~this();
}
class C : B
{
}
class D : C
{
~this();
}

DMD produces the following error:
test.d(13): Error: class `test.D` use of `test.B.~this()` is hidden by `D`; use
`alias ~this = B.~this;` to introduce base class overload set

--


[Issue 22811] use of destructor is hidden by subclass

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22811

Tim  changed:

   What|Removed |Added

   Keywords||C++, rejects-valid

--


[Issue 22812] New: ImportC: C11 does not allow newlines between the start and end of a directive

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22812

  Issue ID: 22812
   Summary: ImportC: C11 does not allow newlines between the start
and end of a directive
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

According to C11 6.10-5 (Preprocessing directives: Constraints)

The only white-space characters that shall appear between preprocessing tokens
within a preprocessing directive (from just after the introducing `#`
preprocessing token through just before the terminating new-line character) are
space and horizontal-tab (including spaces that have replaced comments or
possibly other white-space characters in translation phase 3).

To be clear, any whitespace/comment is fine, but new lines can't be ignored
because they are the terminator for directives.

So the following should result in an error:
---
#
pragma
pack
(
2
)
struct S
{
int i;
short j;
double k;
};
#
pragma
pack
(
)
---

--


[Issue 22812] ImportC: C11 does not allow newlines between the start and end of a directive

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22812

Iain Buclaw  changed:

   What|Removed |Added

   Keywords||accepts-invalid, ImportC
 CC||ibuc...@gdcproject.org

--


[Issue 22813] New: [REG 2.079.1] recursive template expansion

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22813

  Issue ID: 22813
   Summary: [REG 2.079.1] recursive template expansion
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: tim.dl...@t-online.de

The following code compiled with DMD 2.078.1, but does not compile since DMD
2.079.1:

struct Template(int i) { }
uint f()
{
Template!(1) x;
return 0;
}
immutable constant = f();
alias X = Template!constant;

DMD now prints the following error:
test.d(4): Error: struct `test.Template(int i)` recursive template expansion
test.d(4):while looking for match for `Template!1`
test.d(7):called from here: `f()`
test.d(8):while looking for match for `Template!(constant)`

--


[Issue 22813] [REG 2.079.1] recursive template expansion

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22813

Tim  changed:

   What|Removed |Added

   Keywords||rejects-valid

--


[Issue 22814] New: ImportC: C11 lexer deletes escaped new lines during translation

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22814

  Issue ID: 22814
   Summary: ImportC: C11 lexer deletes escaped new lines during
translation
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

Following on from issue 22812, while new lines can't be ignored, they can
however be escaped.

>From C11 5.1.1.2-2:
---
Each instance of a backslash character ( \) immediately followed by a new-line
character is deleted, splicing physical source lines to form logical source
lines. Only the last backslash on any physical source line shall be eligible
for being part of such a splice. A source file that is not empty shall end in a
new-line character, which shall not be immediately preceded by a backslash
character before any such splicing takes place.
---


So whilst issue 22812 is an error, this should be accepted as valid:
---
# \
pragma \
pack \
( \
2 \
)
struct S
{
int i;
short j;
double k;
};
# \
pragma \
pack \
( \
)
---

--


[Issue 22814] ImportC: C11 lexer deletes escaped new lines during translation

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22814

Iain Buclaw  changed:

   What|Removed |Added

   Keywords||ImportC, rejects-valid
 CC||ibuc...@gdcproject.org

--


[Issue 22815] New: extern(C++) constructor cannot be used from C++ (no init symbol blit)

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22815

  Issue ID: 22815
   Summary: extern(C++) constructor cannot be used from C++ (no
init symbol blit)
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ki...@gmx.net

In D, compiler/druntime pre-initialize each class instance (extern(D) and
extern(C++) etc.) by blitting the init symbol (incl. vptr) before invoking a
constructor.

In C++, the constructor initializes the fields directly. So if we call a C++
one from a matching extern(C++) declaration in D, we do a little bit of extra
work with the pre-init blit. The real issue is that invoking an extern(C++)
definition from C++ might likely result in incomplete initialization /
undefined behavior.

Note that simply inserting the full blit as first statement in each extern(C++)
ctor isn't desirable in case of class hierarchies with super(…) calls, or other
this(…) calls. Related in this regard:
https://issues.dlang.org/show_bug.cgi?id=18966

Maybe we should start with deprecating extern(C++) ctor *definitions* for now.
Declaring one defined in C++ is fine.

--


[Issue 22816] New: [REG 2.099] Parser reads files with other extensions

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22816

  Issue ID: 22816
   Summary: [REG 2.099] Parser reads files with other extensions
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

If I compile `foo.c`, but rather `foo.d` exists instead, the parser will
compile *that* module instead.

---
(stable) $ ls foo*
ls: cannot access 'foo*': No such file or directory

(stable) $ ./generated/linux/release/64/dmd -c foo.c
Error: unable to read module `foo`
   Expected 'foo.c' or 'foo/package.d' in one of the following import
paths:
import path[0] = ./generated/linux/release/64/../../../../../druntime/import
import path[1] = ./generated/linux/release/64/../../../../../phobos

(stable) $ touch foo.d
(stable) $ ./generated/linux/release/64/dmd -c foo.c
(stable) $ ls foo*
foo.d  foo.o
---

Worse, it'll still compile the file as if it were the extension you passed on
the command-line.  i.e: `dmd foo.c` will compile `foo.d` as a C file.

--


[Issue 22816] [REG 2.099] Parser reads files with other extensions

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22816

Iain Buclaw  changed:

   What|Removed |Added

 CC||ibuc...@gdcproject.org

--- Comment #1 from Iain Buclaw  ---
Regression caused by https://github.com/dlang/dmd/pull/13193

--


[Issue 22817] New: [REG 2.099] Missing file gives misleading error message

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22817

  Issue ID: 22817
   Summary: [REG 2.099] Missing file gives misleading error
message
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

Caused by https://github.com/dlang/dmd/pull/13134

Old behaviour
---
(stable) $ dmd foo.c
Error: module `foo` is in file 'foo.c' which cannot be read
---

New behaviour
---
(stable) $ ./generated/linux/release/64/dmd foo.c
Error: unable to read module `foo`
   Expected 'foo.c' or 'foo/package.d' in one of the following import
paths:
import path[0] = ./generated/linux/release/64/../../../../../druntime/import
import path[1] = ./generated/linux/release/64/../../../../../phobos

(stable) $ mkdir bar
(stable) $ touch bar/package.d
(stable) $ ./generated/linux/release/64/dmd bar.d
Error: unable to read module `bar`
   Expected 'bar.d' or 'bar/package.d' in one of the following import
paths:
import path[0] = ./generated/linux/release/64/../../../../../druntime/import
import path[1] = ./generated/linux/release/64/../../../../../phobos
---

--


[Issue 22817] [REG 2.099] Missing file gives misleading error message

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22817

Iain Buclaw  changed:

   What|Removed |Added

   Keywords||diagnostic
 CC||ibuc...@gdcproject.org

--


[Issue 22816] [REG 2.099] Parser reads files with other extensions

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22816

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from Dlang Bot  ---
@ibuclaw created dlang/dmd pull request #13707 "fix Issue 22816 - [REG 2.099]
Parser reads files with other extensions" fixing this issue:

- fix Issue 22816 - [REG 2.099] Parser reads files with other extensions

https://github.com/dlang/dmd/pull/13707

--


[Issue 22817] [REG 2.099] Missing file gives misleading error message

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22817

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@ibuclaw created dlang/dmd pull request #13708 "fix Issue 22817 - [REG 2.099]
Missing file gives misleading error message" fixing this issue:

- fix Issue 22817 - [REG 2.099] Missing file gives misleading error message

https://github.com/dlang/dmd/pull/13708

--


[Issue 22817] [REG 2.099] Missing file gives misleading error message

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22817

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #13708 "fix Issue 22817 - [REG 2.099] Missing file gives
misleading error message" was merged into stable:

- c4cf8f09029de2cab3b42e148dcc65e10c29eb4f by Iain Buclaw:
  fix Issue 22817 - [REG 2.099] Missing file gives misleading error message

https://github.com/dlang/dmd/pull/13708

--


[Issue 14692] SIGSEGV during SHA.put

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14692

Mathias LANG  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||pro.mathias.l...@gmail.com
 Resolution|--- |INVALID

--- Comment #8 from Mathias LANG  ---
Looking into this, I noticed the code is triggered from a module constructor:
> #14 0x007687f5 in db.mysql_test() () at source/db.d:17
> #15 0x006f525e in app._sharedStaticCtor1() () at source/app.d:16
> #16 0x00768799 in app.__modsharedctor() ()

The report doesn't mention what version of DMD is being used, but according to
the time of the report, I assume circa 2.068, in which case the line
segfaulting would be
https://github.com/dlang/phobos/blob/v2.068.0/std/digest/sha.d#L723
The stack trace seems to match, and since SHA doesn't change much, I'm pretty
confident this is correct.

The jump to 0x00[...]00 seems to indicate that `transform` is `null`.
Looking into the module, there is indeed a case where it could be `null`: If
`digestSize == 160`, `version = USE_SSSE3`, and the module constructor of your
application was to run before SHA's module ctor
(https://github.com/dlang/phobos/blob/v2.068.0/std/digest/sha.d#L216-L231).

`version = SSSE3` is true on amd64
(https://github.com/dlang/phobos/blob/b82986e64fbb2950af118f4711e1558a4134c803/std/digest/sha.d#L118-L121),
and the first line indicates that `digestSize == 160`:
> #1  0x00712eea in std.digest.sha.SHA!(512, 160).SHA.put(scope 
> const(ubyte)[]...) (this=0x7fffd160, input=...) at 
> /usr/include/dmd/phobos/std/digest/sha.d:723

Based on this, I am going to assume the missing piece (order of module ctor) is
indeed the issue. It would also explain why a different version of the
compiler/runtime and a different backend would work (different order of ctor
running).

Hence, the best way forward to fix this issue is to move your code to the
`main`, so that all modules ctor have a chance to run.

--


[Issue 22816] [REG 2.099] Parser reads files with other extensions

2022-02-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22816

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #3 from Dlang Bot  ---
dlang/dmd pull request #13707 "fix Issue 22816 - [REG 2.099] Parser reads files
with other extensions" was merged into stable:

- 0de1b4ac7d53287f2c3ea8d1209016f83083851d by Iain Buclaw:
  fix Issue 22816 - [REG 2.099] Parser reads files with other extensions

https://github.com/dlang/dmd/pull/13707

--