[Issue 24114] New: no crash on use of a noreturn enum member

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24114

  Issue ID: 24114
   Summary: no crash on use of a noreturn enum member
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

For the following code there's no runtime crash

```
enum E {e1 = 1, e2 = 2, illegal = noreturn}

void main()
{
E e;
// that assignment should have the same effect as assert(0)
e = E.illegal;
// just to be sure
if (e) {}
}
```

--


[Issue 24114] no crash on use of a noreturn enum member

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24114

Basile-z  changed:

   What|Removed |Added

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

--


[Issue 24115] New: No runtime crash on use of a noreturn template argument

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24115

  Issue ID: 24115
   Summary: No runtime crash on use of a noreturn template
argument
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: wrong-code
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

For the following code there's no runtime crash

```
int v(e)()
{
return e + 0;
}

int main()
{
return v!(noreturn)();
}  
```

--


[Issue 24115] No runtime crash on use of a noreturn template argument

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24115

Basile-z  changed:

   What|Removed |Added

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

--


[Issue 24114] no crash on use of a noreturn enum member

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24114

Basile-z  changed:

   What|Removed |Added

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

--


[Issue 24116] noreturn not accepted as argument of a template value parameter

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24116

Basile-z  changed:

   What|Removed |Added

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

--


[Issue 24113] Eager failure of TypeInfo in _d_newclassT even if not used in -betterC

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24113

Richard Cattermole  changed:

   What|Removed |Added

   Keywords||betterC

--


[Issue 24113] New: Eager failure of TypeInfo in _d_newclassT even if not used in -betterC

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24113

  Issue ID: 24113
   Summary: Eager failure of TypeInfo in _d_newclassT even if not
used in -betterC
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: alphaglosi...@gmail.com

Linux Mint 21.2, dmd 2.105. This works on dmd with dmd 2.105-beta1

```
/usr/include/dmd/druntime/import/core/lifetime.d(2761,42): Error: `TypeInfo`
cannot be used with -betterC
```

This corresponds to the function ``_d_newclassT``.

It seems ``_d_newclassT`` is imported by object.d via

```d
public import core.lifetime : _d_newitemT;
```

Versioning out the import from object.d stops this error. This is rather
curious as classes should generate a different error if it were used and that
hook function is templated.

Replacing it with a deprecated function, results in no deprecations.

--


[Issue 24117] New: noreturn can be used as expression

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24117

  Issue ID: 24117
   Summary: noreturn can be used as expression
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: accepts-invalid
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

Example 1, in an AddExpression:

```d
int v(e)()
{
return e + 0;
}

int main()
{
return v!(noreturn)();
} 
```

Example 2, as EnumMember initializer:

```d
enum E {e1 = 1, e2 = 2, illegal = noreturn}

void main()
{
E e;
e = E.illegal;
}
```

--


[Issue 24116] New: no return not accepted as argument of a template value parameter

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24116

  Issue ID: 24116
   Summary: no return not accepted as argument of a template value
parameter
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: b2.t...@gmx.com

For the following code

```
int v(int e)()
{
return e + 0;
}

int main()
{
return v!(noreturn)();
} 
```

dmd exits with:

> temp_7F361AD45870.d:8:12: Error: template instance `v!(noreturn)` does not 
> match template declaration `v(int e)()`

But noreturn is supposed to implictly convert to `int`

--


[Issue 24116] noreturn not accepted as argument of a template value parameter

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24116

Basile-z  changed:

   What|Removed |Added

Summary|no return not accepted as   |noreturn not accepted as
   |argument of a template  |argument of a template
   |value parameter |value parameter

--


[Issue 24115] No runtime crash on use of a noreturn template argument

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24115

Basile-z  changed:

   What|Removed |Added

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

--


[Issue 24115] No runtime crash on use of a noreturn template argument

2023-08-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=24115

Basile-z  changed:

   What|Removed |Added

 Resolution|FIXED   |INVALID

--