-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bugfixes for <any>
#3965
Merged
Merged
Bugfixes for <any>
#3965
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
9eb5074
fix self-move-assignment
achabense 2b4bd0d
add test for self-move-assignment
achabense 8f56d7e
add `_STD` qualication to allow for incomplete pointer types etc
achabense 8fe3f3c
add test for support for incomplete types
achabense cfe55eb
10->20
achabense bbbff54
rename test folder
achabense 33925fa
test fix
achabense 7666be3
update `/tests/std/test.lst`
achabense 36ce5f6
real test fix
achabense 5f9f683
suppress warnings directly
achabense a44af87
better approach
achabense 02b0d34
nits
achabense 6489028
nits
achabense 03fba39
make adl-test more focused
achabense da3f334
self-assignment real fix
achabense 798e89c
enhance tests
achabense 2496df5
improvements
achabense ff1d9df
make value creation obvious
achabense a9c8d83
simplify ADL test; move to P0220R1_any
achabense 193e2fc
enhance tests
achabense a3a3009
Merge branch 'main' into _Any_fix
StephanTLavavej 70207a8
Implicitly construct when calling `_Assign`.
StephanTLavavej 3afe951
Work around `/clr`.
StephanTLavavej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
achabense marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
RUNALL_INCLUDE ..\usual_17_matrix.lst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <any> | ||
#include <utility> | ||
|
||
struct incomplete; | ||
|
||
template <class T> | ||
struct wrapper { | ||
T t; | ||
}; | ||
|
||
struct nontrivial { | ||
nontrivial() {} | ||
~nontrivial() {} | ||
}; | ||
|
||
int main() { | ||
using foo = wrapper<incomplete>*; | ||
struct bar { | ||
foo p{}; | ||
nontrivial q{}; | ||
}; | ||
struct baz { | ||
foo p[20]{}; | ||
}; | ||
|
||
std::any a{foo{}}, b(bar{}), c{baz{}}; | ||
a = a, b = b, c = c; | ||
a = std::move(a), b = std::move(b), c = std::move(c); | ||
auto a_ = std::any_cast<foo>(a); | ||
auto b_ = std::any_cast<bar>(b); | ||
auto c_ = std::any_cast<baz>(c); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is combining unrelated fixes, which makes things harder to review and harder to investigate/revert when things go wrong. They're small enough that I don't think we need to request changes, but I wanted to mention this for the future.
In general, I would say that combining unrelated cleanups is less risky than combining fixes; we want to avoid grab-bag PRs either way, but when semantic changes are involved, we should be more disciplined.