template ctor overload Segmentation fault

user1234 user1234 at 12.de
Mon Dec 13 08:57:44 UTC 2021


On Sunday, 12 December 2021 at 11:57:43 UTC, vit wrote:
> Hello, why does this code fail to compile?
>
> ```d
> struct Foo(T){
>     this(Rhs, this This)(scope Rhs rhs){
>     }
>
>     this(ref scope typeof(this) rhs){
>     }
> }
>
>
> struct Bar{
> 	Foo!int foo;
> }
>
> void main(){
> }
> ```
>
> error: Segmentation fault (core dumped)

Firstly, report the crash with the keyword "ice".

Then, there might be something not allowed (in some situations 
the compiler cant decide which ctor to use) but you cant see it 
for now.



More information about the Digitalmars-d-learn mailing list