[Issue 23029] ImportC: _Generic treats pointer to const and regular pointers as the same type

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23029

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@WalterBright created dlang/dmd pull request #14014 "fix Issue 23029 - ImportC:
_Generic treats pointer to const and regul…" fixing this issue:

- fix Issue 23029 - ImportC: _Generic treats pointer to const and regular
pointers as the same type

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

--


[Issue 18216] struct no size because of forward reference

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18216

--- Comment #4 from Dlang Bot  ---
dlang/dmd pull request #14012 "Add test for Issue 18216" was merged into
master:

- 8ae79d141803a13973d3a476aae37601d954b2a7 by RazvanN7:
  Add test for Issue 18216

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

--


[Issue 23028] ImportC: found _Generic instead of statement

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23028

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #14013 "fix Issue 23028 - ImportC: found _Generic
instead of statement" was merged into master:

- 5be857bed4f935ff00c8cae2388a17d4fe18c274 by Walter Bright:
  fix Issue 23028 - ImportC: found _Generic instead of statement

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

--


[Issue 22202] Wrong error message for implicit call to @system copy constructor in @safe code

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22202

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@RazvanN7 created dlang/dmd pull request #14015 "Fix Issue 22202 - Wrong error
message for implicit call to @system copy constructor in @safe code" fixing
this issue:

- Fix Issue 22202 - Wrong error message for implicit call to @system copy
constructor in @safe code

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

--


[Issue 22991] GC array literals restricted in size

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22991

--- Comment #4 from Iain Buclaw  ---
(In reply to Dennis from comment #2)
> Note that the spec currently says:
> 
> > The total size of a static array cannot exceed 16Mb.
> 
> https://dlang.org/spec/arrays.html#static-arrays
> 
> But `bla` is 32Mb

That's true for Optlink, but not others, where the max static data size allowed
is half the address space.

--


[Issue 22202] Wrong error message for implicit call to @system copy constructor in @safe code

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22202

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #14015 "Fix Issue 22202 - Wrong error message for
implicit call to @system copy constructor in @safe code" was merged into
master:

- 3d2488c630efae642bbfaf23e7f1fa743cc14857 by RazvanN7:
  Fix Issue 22202 - Wrong error message for implicit call to @system copy
constructor in @safe code

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

--


[Issue 23036] Rvalue constructor with default parameter crashes compiler in the presence of a copy constructor

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23036

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #4 from Dlang Bot  ---
dlang/dmd pull request #14011 "Fix Issue 23036 - [REG2.086]Rvalue constructor
with default parameter…" was merged into master:

- 2d9bb00a46284e27042fa30b1e0a82ce16a20fd0 by RazvanN7:
  Fix Issue 23036 - [REG2.086]Rvalue constructor with default parameter crashes
compiler in the presence of a copy constructor

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

--


[Issue 23037] New: importC: type with only type-qualifier doesn't work

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23037

  Issue ID: 23037
   Summary: importC: type with only type-qualifier doesn't work
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: ImportC
  Severity: minor
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: du...@neet.fi
CC: du...@neet.fi

const a;  // ignored, doesn't declare "a"
const b = 1;  // syntax error
int c = sizeof(const);// segfault in src/dmd/expression.d:3397
int d = (const)0; // segfault in src/dmd/mtype.d:2710
int *e = (const*)0;   // segfault in src/dmd/mtype.d:4050
enum E : const { ee=1, }; // assert in src/dmd/dsymbolsem.d:2164

depending on what C11 allows, these should be either rejected in the parser or
made to default to "int" like in other compilers

the line numbers are at dmd commit 41ca11ebf3cc9086906958ea448b69bf37dc36a0

--


[Issue 23038] New: importC: sizeof inside struct has struct members in scope

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23038

  Issue ID: 23038
   Summary: importC: sizeof inside struct has struct members in
scope
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: ImportC
  Severity: minor
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: du...@neet.fi
CC: du...@neet.fi

char a;
struct
{
long long a;
char b[sizeof(a)];
//typeof(a) c;
} s;
_Static_assert(sizeof(s.b) == sizeof(char), "1"); // fails
//_Static_assert(sizeof(s.c) == sizeof(char), "2"); // fails

dmd uses the struct field named "a", other compilers use the global

found when testing the typeof() PR (it is affected too)

--


[Issue 23039] New: importC: declaration with array length has itself in scope

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23039

  Issue ID: 23039
   Summary: importC: declaration with array length has itself in
scope
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: ImportC
  Severity: minor
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: du...@neet.fi
CC: du...@neet.fi

const int x = 1;
void fn1() { char x[x]; }
struct S1 { char x[x]; };
//void fn2() { typeof(x) x; }
//struct S2 { typeof(x) x; };

these give circular reference errors in dmd but work in other compilers (except
gcc doesn't like "struct S1" using the global)

found when testing the typeof PR, it is also affected

--


[Issue 23029] ImportC: _Generic treats pointer to const and regular pointers as the same type

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23029

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #14014 "fix Issue 23029 - ImportC: _Generic treats
pointer to const and regul…" was merged into master:

- 2debd946c8d5c24e47436f657d49bb3257daf1fc by Walter Bright:
  fix Issue 23029 - ImportC: _Generic treats pointer to const and regular
pointers as the same type

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

--


[Issue 17500] Add a CLI flag configure the location for AST dumps produced by -vcg-ast

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17500

Richard Cattermole  changed:

   What|Removed |Added

 CC||alphaglosi...@gmail.com

--- Comment #1 from Richard Cattermole  ---
This has come up on Discord in relation to dub.

It was surprising to the user that the location was tied to the source file
rather than the project directory.

It would be ideal if dub could change the location automatically if the flag is
passed so that it would be less of a surprise.

--


[Issue 23040] New: importC: optimizer rejects null dereference of volatile pointer

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23040

  Issue ID: 23040
   Summary: importC: optimizer rejects null dereference of
volatile pointer
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: ImportC, rejects-valid
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: du...@neet.fi
CC: du...@neet.fi

void my_fatal()
{ 
*((volatile unsigned int *) 0) = (unsigned int) 0xdeadbeefUL;
}

compile: dmd -O -c test.c

Error: null dereference in function my_fatal

i see in
https://github.com/dlang/dmd/blob/b1ac484/src/dmd/backend/cgelem.d#L6253 where
the error is emitted, it has a check to allow this with volatile pointers but
the keyword is ignored in importC

--


[Issue 23034] importC: head-const struct confused with multiple files on command line

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23034

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
Ah, took me hours to track this one. The trouble is addSTC() to add in a
`const`. In D, this works because type names are identifiers, and mangling is
skipped for TypeIdentifier. In C, these come through as a TypeTag, which does
get mangled, but semantic() hasn't been run, so S1 and S2 both mangle as "x@"
and are therefore treated as the same type.

--


[Issue 23034] importC: head-const struct confused with multiple files on command line

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23034

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from Dlang Bot  ---
@WalterBright created dlang/dmd pull request #14016 "fix Issue 23034 - importC:
head-const struct confused with multiple f…" fixing this issue:

- fix Issue 23034 - importC: head-const struct confused with multiple files on
command line

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

--


[Issue 23030] importC: errors using typedef struct after first use as const

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23030

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
This may be the same as https://issues.dlang.org/show_bug.cgi?id=23034

--


[Issue 23030] importC: errors using typedef struct after first use as const

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23030

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=23034

--


[Issue 23034] importC: head-const struct confused with multiple files on command line

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23034

Walter Bright  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=23030

--


[Issue 23030] importC: errors using typedef struct after first use as const

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23030

--- Comment #2 from Walter Bright  ---
oh well, it isn't.

--


[Issue 23031] importC: hex character escapes should be variable length

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23031

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@WalterBright created dlang/dmd pull request #14017 "fix Issue 23031 - importC:
hex character escapes should be variable l…" fixing this issue:

- fix Issue 23031 - importC: hex character escapes should be variable length

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

--


[Issue 23040] importC: optimizer rejects null dereference of volatile pointer

2022-04-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23040

Walter Bright  changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
volatile is ignored in ImportC because the D type system has no concept of
volatile.

--