[PATCH] D114105: [clang-tidy] Ignore narrowing conversions in case of bitfields

Clement Courbet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 25 01:44:45 PST 2021


courbet added a comment.

Yes, I think the new approach is what we want. The comments also make it much clearer.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-bitfields.cpp:1
+// RUN: %check_clang_tidy %s cppcoreguidelines-narrowing-conversions %t \
+// RUN:   -std=c++17 -- -target x86_64-unknown-linux
----------------
Can you add a test with:

```

void takesInt(int);

...

takesInt(x.id);
```

I think this suffers from the same problem currently.


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

https://reviews.llvm.org/D114105



More information about the cfe-commits mailing list