Closed h-2 closed 1 year ago
@llvm/issue-subscribers-clang-tidy
Thanks for the issue! A possible fix - https://reviews.llvm.org/D135476
Thanks for coming up with a fix so quickly! Do I understand correctly that it would just ignore all constrained constructors in the future?
That would definitely solve the false-positive warning, although actually evaluating the constraint on the type would be even more helpful, of course. Because, while the warning did return quite a few false-positives in my codebase, it actually did turn up a wrongly constrained constructor which did need fixing.
But I don't know at all how clang-tidy works and whether it is even capable of performing such a check, so I am happy with the current fix, too!
Do I understand correctly that it would just ignore all constrained constructors in the future?
Hi! Yes, I just ignore all constrained constructors. I had an idea to evaluate constraints too. But the check's code doesn't evaluate constraints for enable_if
(and concepts are sort of evolved enable_if
), so I decided to not overengineer the check.
Also I don't know if clang-tidy is able to evaluate constraints. I haven't figured it out yet. Let's look what other devs say on this patch =)
results in
although the constraints prevent the constructor from ever being instantiated with either
small_vector const &
orsmall_vector
.edit:
Ubuntu package: 16~++20221005031330+a3a741c0bbb2-1~exp1~20221005151435.464