Open Quuxplusone opened 4 years ago
Static analyzer does not participate at all in this warning. It is a normal frontend warning. To Frontend component.
I seem to remember running into this with respect to a container containing
std::pair elements, but I can't find the details now. I thought I'd filed
a bug but apparently not.
A not very long time ago, I have been worked with clang frontend.
should I try this bugfix?
(In reply to david fuqiang fan from comment #3)
> A not very long time ago, I have been worked with clang frontend.
> should I try this bugfix?
I think it should be a relatively simple thing to fix, yes. You're quite
welcome to have a go at it.
(In reply to David Blaikie from comment #4)
> (In reply to david fuqiang fan from comment #3)
> > A not very long time ago, I have been worked with clang frontend.
> > should I try this bugfix?
>
> I think it should be a relatively simple thing to fix, yes. You're quite
> welcome to have a go at it.
Ok, I am working.
(In reply to Jake Arkinstall from comment #0)
> 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.
I can not find your name as a reviewer.
https://reviews.llvm.org/D92956
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.