﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
138	"Reference parameter in constructor with ""new"" initialization"	pabuhr		"This works if I change the cluster parameter from reference to pointer.
{{{
#include <stdlib.hfa>

struct cluster {
   unsigned int nthreads;
};

struct Worker {};

void ?{}( Worker & worker, cluster & wc ) {} // change to pointer

int main() {
   cluster * clust;
   Worker * fred = new( *clust ); // remove dereference
}

@plg2[17]% a.out
Cforall Runtime error (UNIX pid:11897) Addressing invalid memory at location (nil)
Possible cause is reading outside the address space or writing to a protected area within the address space with an invalid pointer or subscript.
Error occurred while executing thread Main Thread (0x7fa1f0add080).
Stack back trace for: /u0/pabuhr/software/cfa-cc/lib/cfa/x64-debug/libcfa.so.1
(0) a.out : _X4mainFi___1 + 0xa0  [0x400b5a]
Abort (core dumped)
}}}
"	defect	new	minor	cfa-cc	1.0			
