Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: direct-init const ref instead of list-init#1175

Merged
carsonRadtke merged 1 commit into
microsoft:mainfrom
carsonRadtke:gh-1162
Dec 13, 2024
Merged

fix: direct-init const ref instead of list-init#1175
carsonRadtke merged 1 commit into
microsoft:mainfrom
carsonRadtke:gh-1162

Conversation

@carsonRadtke
Copy link
Copy Markdown
Member

fixes: #1162

gcc has a bug that generates a call to the copy constructor when list initializing a const reference. This PR offers a workaround which is to direct initialize the value.

see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117900

fixes: #1162

gcc has a bug that generates a call to the copy constructor when list
initializing a const reference. This PR offers a workaround which is to
direct initialize the value.

see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117900
@carsonRadtke
Copy link
Copy Markdown
Member Author

This seems to work locally. I will rebase and merge #1160 which adds a test for this.

@carsonRadtke carsonRadtke self-assigned this Dec 13, 2024
@carsonRadtke carsonRadtke added Priority: Medium Should be addressed in due course Type: Bug Indicates a bug or error Status: Review Needed Needs review from GSL maintainers labels Dec 13, 2024
@carsonRadtke carsonRadtke merged commit 8a0e3d8 into microsoft:main Dec 13, 2024
@carsonRadtke carsonRadtke deleted the gh-1162 branch December 13, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Medium Should be addressed in due course Status: Review Needed Needs review from GSL maintainers Type: Bug Indicates a bug or error

Projects

Development

Successfully merging this pull request may close these issues.

not_null<std::unique_ptr<>> not working in v4.1.0 with g++-10

1 participant