Skip to content

Implement P2186R2 Removing Garbage Collection Support#2010

Merged
StephanTLavavej merged 7 commits into
microsoft:mainfrom
fsb4000:fix1988
Jun 29, 2021
Merged

Implement P2186R2 Removing Garbage Collection Support#2010
StephanTLavavej merged 7 commits into
microsoft:mainfrom
fsb4000:fix1988

Conversation

@fsb4000
Copy link
Copy Markdown
Contributor

@fsb4000 fsb4000 commented Jun 14, 2021

Fixes #1988

@fsb4000 fsb4000 requested a review from a team as a code owner June 14, 2021 05:07
Copy link
Copy Markdown
Contributor

@barcharcraz barcharcraz left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

The removal of the feature should be controlled in the same was as we do for features removed in CXX20

See yvals_core.h starting around line 1061 (search for _HAS_FEATURES_REMOVED_IN_CXX20)

Comment thread stl/inc/memory Outdated
Comment thread tests/libcxx/expected_results.txt
Comment thread tests/libcxx/skipped_tests.txt
Comment thread tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp Outdated
Comment thread tests/tr1/tests/memory/test.cpp Outdated
Comment thread tests/tr1/tests/memory/test.cpp Outdated
Comment thread tests/libcxx/expected_results.txt Outdated
Comment thread tests/libcxx/skipped_tests.txt Outdated
Comment thread stl/inc/yvals_core.h


#ifndef _HAS_FEATURES_REMOVED_IN_CXX23
#define _HAS_FEATURES_REMOVED_IN_CXX23 (!_HAS_CXX23)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is that correct. The default would be that those Features are removed.

Semantically this appears to be flipped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as https://github.com/microsoft/STL/blob/main/stl/inc/yvals_core.h#L1060-L1063

Yes. I think it's correct. It's name for users. If I as user define

#define _HAS_FEATURES_REMOVED_IN_CXX23  1

then include some standard hearders
and then all deleted features in c++23 are available for me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, this is correct.

FYI: GitHub doesn't preview line-numbered links to files in main, because as main changes, the line numbers could be invalidated. However, if you press the y keyboard shortcut when viewing a file, the link will transform into a commit permalink, and then citing that in an issue/comment will be previewed. Here, https://github.com/microsoft/STL/blob/1866b848f0175c3361a916680a4318e7f0cc5482/stl/inc/yvals_core.h#L1060-L1063 will be previewed as:

STL/stl/inc/yvals_core.h

Lines 1060 to 1063 in 1866b84

// P0619R4 Removing C++17-Deprecated Features
#ifndef _HAS_FEATURES_REMOVED_IN_CXX20
#define _HAS_FEATURES_REMOVED_IN_CXX20 (!_HAS_CXX20)
#endif // _HAS_FEATURES_REMOVED_IN_CXX20

default_delete<int[]> dd1{default_delete<int[]>{}};
dd1(new int[5]);

#if _HAS_GARBAGE_COLLECTION_SUPPORT_DELETED_IN_CXX23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same, I would have expected those to be there if they have not been deleted

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@StephanTLavavej StephanTLavavej self-assigned this Jun 24, 2021
@StephanTLavavej

This comment has been minimized.

@StephanTLavavej StephanTLavavej merged commit e745bad into microsoft:main Jun 29, 2021
@StephanTLavavej
Copy link
Copy Markdown
Member

Thanks for implementing this removal, which will help avoid confusing programmers! 🎉 🎉 🎉

@fsb4000 fsb4000 deleted the fix1988 branch June 29, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx23 C++23 feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P2186R2 Removing Garbage Collection Support

5 participants