[libcxx-commits] [PATCH] D118616: [libc++] Use -I instead of -isystem to include headers in the test suite

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 21 11:33:25 PST 2022


Mordante added a comment.

I didn't look at the patch closely.



================
Comment at: libcxx/include/__iterator/iterator_traits.h:201
     { __i -  __n } -> same_as<_Ip>;
-    { __i -  __i } -> same_as<decltype(__n)>;
+    { __i -  __i } -> same_as<decltype(__n)>; // NOLINT(misc-redundant-expression)
     {  __i[__n]  } -> convertible_to<iter_reference_t<_Ip>>;
----------------
philnik wrote:
> Quuxplusone wrote:
> > Please file a bug for this (I assume a clang-tidy bug, right?) and link it from here and/or in the commit message.
> clang-tidy is kind-of right. `__i - __i` is a redundant expression, and I had to look at it a few times before I got why it's correct in this case. Where else would subtracting something from itself make sense?
I agree with Arthur, this seems like a bug. clang-tidy uses the AST so it knows the code is in a requires clause.

I have a strong preference to at least mention the bug here, that makes validating whether it's fixed in the future easier. I don't object to adding it to the commit message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118616/new/

https://reviews.llvm.org/D118616



More information about the libcxx-commits mailing list