Skip to content
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

avoid using temporary objects in followAllReferences() #6697

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

-D__GNUC__ --check-level=exhaustive ../lib/utils.cpp

Clang 17 727,573,266 -> 722,149,127
GCC 14 773,604,329 -> 764,052,021

The example from https://trac.cppcheck.net/ticket/10765#comment:4:

Clang 17 3,785,661,648 -> 3,745,218,741
GCC 14 4,083,156,774 -> 4,013,339,574

@chrchr-github
Copy link
Collaborator

How far away are we from activating modernize-use-emplace?

@firewave
Copy link
Collaborator Author

How far away are we from activating modernize-use-emplace?

It is enabled. This was not detected because the object could not be created without the missing constructor - see https://godbolt.org/z/MK1a9eG5h.

The fix-it will lead to broken code though. I will file a ticket later on.

@chrchr-github chrchr-github merged commit 4f41804 into danmar:main Aug 15, 2024
63 checks passed
@chrchr-github
Copy link
Collaborator

chrchr-github commented Aug 15, 2024

Using the compiler-generated constructor requires C++20 (but there still won't be a warning for the original code):
https://godbolt.org/z/fdcaT3rx3

@firewave firewave deleted the ast-move branch August 15, 2024 10:09
@firewave
Copy link
Collaborator Author

The fix-it will lead to broken code though. I will file a ticket later on.

I filed llvm/llvm-project#104565 about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants