[Issue 7184] parse error on *(x)++

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7184

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #13 from Dlang Bot  ---
@ntrel created dlang/dmd pull request #15410 "Fix Issue 7184 - parse error on
*(x)++" fixing this issue:

- Fix Issue 7184 - parse error on *(x)++

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

--


[Issue 23973] static constructors should have to be nothrow

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23973

Jonathan M Davis  changed:

   What|Removed |Added

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

--- Comment #4 from Jonathan M Davis  ---
(In reply to RazvanN from comment #2)
> Would make sense to apply the same constraints for static destructors?
> Actually, I think that that would make sense for constructors and
> destructors in general.

Constructors in general are a very different issue from static constructors.
Throwing from constructors on types is an extremely normal thing to do. Without
that, you're often forced to do two step initialization in order to be able to
tell the caller that the arguments are invalid. Disallowing throwing from
normal constructors would very much be an anti-pattern.

It _might_ make sense to require that destructors on types be nothrow, but I'm
not sure. C++ went and made noexcept the default for destructors, and their
standard library doesn't allow destructors to throw exceptions, but IIRC, some
projects actually do it. So, as I understand it, the C++ community considers it
something that should generally be avoided but not necessarily something that
should absolutely never be done. So, I think that we'd have to look at the
situation very carefully before disallowing it in D.

Regardless, the question of static constructors and destructors and nothrow is
very different from non-static ones, and the issues that Atila brought up with
static constructors do not apply to regular constructors at all outside of them
being called from static constructors - and those issues then apply to any code
that would throw an exception from within a static constructor.

--


[Issue 24046] static destructors should be allowed in function bodies

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24046

Max Samukha  changed:

   What|Removed |Added

 CC||maxsamu...@gmail.com

--- Comment #1 from Max Samukha  ---
While I agree that function-local static constructors/destructors should just
work, you can work around this bug by wrapping the destructor in a struct.

--


[Issue 24046] New: static destructors should be allowed in function bodies

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24046

  Issue ID: 24046
   Summary: static destructors should be allowed in function
bodies
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

Here is why : as we can hide static variables in function bodies there should
be a way to cleanup them.

A way to do that would be to allow local static destructors, for example

```d
struct S { }

S getS()
{
static S result;

static ~this() // run when the program finishes
{
destroy(result);
}

return result ? result : (result = new S);
} 
```

--


[Issue 18609] `is` expression identifier accessible outside `static if`

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18609

Nick Treleaven  changed:

   What|Removed |Added

 CC||destructiona...@gmail.com

--- Comment #3 from Nick Treleaven  ---
*** Issue 21078 has been marked as a duplicate of this issue. ***

--


[Issue 21078] static if(is(T IDENT)) introduces IDENT beyond static if's scpe

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21078

Nick Treleaven  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #5 from Nick Treleaven  ---


*** This issue has been marked as a duplicate of issue 18609 ***

--


[Issue 24045] New: Compiler fails to recognize overlapping Union elements in CTFE

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24045

  Issue ID: 24045
   Summary: Compiler fails to recognize overlapping Union elements
in CTFE
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: pun...@coverify.org

enum bool bar = foo(42);

bool foo(ubyte c) {
  union U {
uint a;
ubyte[4] b;
  }
  U u;
  u.b[0] = c;
  assert (u.a == c, "This should never happen");
  return true;
}

--


[Issue 23279] Segmentation fault on mixin template + using unknown type

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23279

--- Comment #7 from Dlang Bot  ---
@RazvanN7 updated dlang/dmd pull request #15406 "Fix Issue 23951 -
traits(getMember) does not follow alias this" fixing this issue:

- Fix Issue 23279 - ICE when using traits(hasMember) with an erroneous member

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

--


[Issue 24041] Anon enum member ignores repeated type or identifier

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24041

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #3 from Dlang Bot  ---
dlang/dmd pull request #15392 "Fix several errors parsing enum members" was
merged into master:

- 9be3f393fdbf2f6ed25aefeb24f66349763e4fbd by Nick Treleaven:
  Fix Issue 24041 - Anon enum member ignores repeated type or identifier

  Also adds test for missing initializer when type is specified and tweaks
  that error.

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

--


[Issue 24044] Support float opCmp(...) with array

2023-07-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24044

Dlang Bot  changed:

   What|Removed |Added

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

--- Comment #2 from Dlang Bot  ---
dlang/dmd pull request #15407 "Fix 24044 - Support float opCmp(...) with array"
was merged into master:

- 6b026900c89d3fc936af71b77609333c7b7397ac by Dennis Korpel:
  Fix 24044 - Support float opCmp(...) with array

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

--