Avoid nonnull warning in rvalue construction of TfSmallVector without local storage#4036
Open
nvmkuruc wants to merge 1 commit intoPixarAnimationStudios:devfrom
Open
Avoid nonnull warning in rvalue construction of TfSmallVector without local storage#4036nvmkuruc wants to merge 1 commit intoPixarAnimationStudios:devfrom
nonnull warning in rvalue construction of TfSmallVector without local storage#4036nvmkuruc wants to merge 1 commit intoPixarAnimationStudios:devfrom
Conversation
Contributor
|
Filed as internal issue #USD-12078 (This is an automated message. See here for more information.) |
2abb85b to
3fc625f
Compare
nonnull warning in TfSmallVector rvalue construction without local storage
nonnull warning in TfSmallVector rvalue construction without local storagenonnull warning in rvalue construction of TfSmallVector without local storage
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Change(s)
TfSmallVectorsupports instantiations with no local storage (the capacity template argument set to 0). These are utilized inpxr/exec.The
TfSmallVectormove constructor assumes is that if the sizes of the local storage and the rvalue parameter are the same, the rvalue's data can be moved into the constructing object's local storage. However, if the local storage size is 0, the_UninitializedMovetries to move an empty range into non-existent local storage. In newer versions of GCC, this causes a warning.This change introduces a
constexprguard to only apply the move if local storage is available.With this change, the following build command should build without warnings or errors in GCC 13.
Link to proposal (if applicable)
Fixes Issue(s)
Checklist
I have created this PR based on the dev branch
I have followed the coding conventions
I have added unit tests that exercise this functionality (Reference:
testing guidelines)
I have verified that all unit tests pass with the proposed changes
I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)