Opened 6 years ago

Closed 2 years ago

#92 closed defect (fixed)

Field with deleted copy constructors don't work

Reported by: Thierry Delisle Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

this code does not compile:

struct fred{};

void ?{}(fred &, fred) = void;
fred ?=?(fred &, fred) = void;

struct superFred {
	fred;
};

void foo() {
	superFred fred;
}

Change History (3)

comment:1 Changed 6 years ago by Thierry Delisle

Better test case:

struct fred{};

void  ?{}(fred & this, int count = 1);
void  ?{}(fred & this, fred & other) = void;
void ^?{}(fred & this);
fred ?=?(fred & this, const fred & other) = void;

struct superFred {
	fred f;
};

void foo() {
	superFred f;
}

comment:2 Changed 6 years ago by Rob Schluntz

I've made some progress on this. Default arguments do not add to the conversion cost anymore, so default constructing superFred works now.

Fixing the reference vs. non-reference parameter issue is proving to be trickier. I've gotten to the point where deleting the assignment or copy constructor with reference parameters successfully hides the generated functions, but there are currently issues with this approach since assertions have to match.

I started making the change to reference parameters for the generated functions, but this quickly cascades to needing to change the prelude. Since this is a big change, I want to discuss it on Wednesday.

In summary, there are still at least two issues here:
1) Assertion resolution needs to be relaxed (I believe Aaron's working on this)
2) The prelude needs non-trivial modifications

comment:3 Changed 2 years ago by Thierry Delisle

Resolution: fixed
Status: newclosed

This compiles but causes warnings. Warnings are in a different ticket : #262.

Note: See TracTickets for help on using tickets.