www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22574] New: Compiler segfaults on `template test(x* x)`

https://issues.dlang.org/show_bug.cgi?id=22574

          Issue ID: 22574
           Summary: Compiler segfaults on `template test(x* x)`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: maxhaton gmail.com

Since approx 2.089.1 the following code causes the compiler to segfault

```
template segfaults(x* x)
{

}
```
```
tempseg.d(8): Error: variable `x` is used as a type
Segmentation fault (core dumped)
```
This is a result of 6ebafdcbddca5c6cb01082f062cf68e2bcf3c8c3
(https://github.com/dlang/dmd/pull/10450)

The segfault can be fixed easily but the code here stinks (i.e. the error
message is inane).

--
Dec 06 2021