-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzergood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
Bugzilla Link | 48011 |
Version | 11.0 |
OS | Linux |
CC | @dwblaikie,@devincoughlin,@randomnetcat,@pogo59,@zygoloid,@Cry-Thomas |
Extended Description
On the Cpplang slack, user Wolle posted a curious warning that came from range-loop-analysis.
Here's a minimal example: https://godbolt.org/z/1cxs43. Note that without the copy assignment operator overload, the warning is not present.
The range-based for loop performs a copy construction, so that is what should be checked for.
At https://clang.llvm.org/doxygen/SemaStmt_8cpp_source.html#l02824, the check is on whether the type is trivially copyable, not whether it is trivially copy constructible, which is a weaker requirement (but the relevant one in this case). I am not intimately familiar with clang sourcecode, but I believe this to be the cause of the warning.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzergood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute