Skip to content

[Sema] Provide copy constructor/assignment operator for TypeCheckRequ… #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2015
Merged

Conversation

dcci
Copy link
Member

@dcci dcci commented Dec 16, 2015

…est.

One of the member variant of the union has a non-trivial copy
constructor, therefore the copy cosntructor is implicitly deleted
(in C++11). Provide the constructor and the copy assignment operator
explictly in order to avoid build errors.

Doug Gregor approved this on swift-dev.
https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000329.html

Thanks!

Davide

…est.

One of the member variant of the union has a non-trivial copy
constructor, therefore the copy cosntructor is implicitly deleted
(in C++11). Provide the constructor and the copy assignment operator
explictly in order to avoid build errors.

TypeCheckRequest(const TypeCheckRequest &T) { *this = T; }

TypeCheckRequest& operator=(const TypeCheckRequest &T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be equivalent to this? (I'm not entirely sure if that's legal, I haven't written C++ in a while)

TypeCheckRequest(const TypeCheckRequest &T) = default;
TypeCheckRequest& operator=(const TypeCheckRequest &T) = default;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it wouldn't. I tried that earlier and clang rejects it, I think correctly.
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf and other papers talk about this.

@gribozavr
Copy link
Contributor

@DougGregor has OK'ed this patch on the mailing list. I am running tests.

@gribozavr
Copy link
Contributor

@dcci Thanks for the patch, merging!

gribozavr added a commit that referenced this pull request Dec 20, 2015
[Sema] Provide copy constructor/assignment operator for TypeCheckRequ…
@gribozavr gribozavr merged commit 7778955 into swiftlang:master Dec 20, 2015
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
XFAIL of ReactiveObjC applies to 5.5 branch as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants