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.
Fixed gcc linker error 58:
How to reproduce:
Step1. Build the library with a test project deployed on gcc 12.3 on Ubuntu
Step2. Look at the following linker error:
This is traced back line 365: https://github.com/google/googletest/pull/4477/files#diff-97f768d897442b94f24002f6bcff7124e3c73d05b3916fb492ee29436ce0701fL635
specifically the
args.size() + 1
where the code analysis tool sees the potential issue of overflowing the storage limits when expanding std::unique_ptr<[]>.
This is easily fixable by abandoning the awkward std::unique_ptr<[]>, since it can be better represented by an std::vector.
granted, likely a bug in the gcc code generation, but it has been there for at least 6 months, someone should have noticed by now. std::unique_ptr<[]> is not great, should have used a std::vector anyways.