[PATCH] D41740: [clang-tidy] Adding a new bugprone check for streaming objects of type int8_t or uint8_t

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 6 03:03:27 PST 2018

JonasToth added a comment.

In https://reviews.llvm.org/D41740#968567, @BRevzin wrote:

> In https://reviews.llvm.org/D41740#968134, @JonasToth wrote:
> > Could you please add a test case with a template that reduces the type to int8 or uint8?
> I don't actually know how to do that. I tried a few things, but getting the type of the expression through a template gets me directly to `unsigned char`, not to `uint8_t`.

Yes that is possible. Templates ignore the typedefnames. I think that needs to be considered. It might be relevant for a templated operator<<.

It would be nice to have these cases in tests to document the issue. A note in the docs wouldn't hurt too.


More information about the cfe-commits mailing list