[llvm] fix some warnings in SmallPtrSetTest (PR #77956)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 15:06:48 PST 2024


dwblaikie wrote:

> > > Warnings are related to places which should use braces
> > 
> > 
> > Could you paste a few of these warnings to here? I don't see warnings with my build and I'm curious what the compiler is complaining about.
> > In general, the llvm coding style doesn't require braces around single-line if/for statements like this: https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements.
> > I think it makes sense to add these with `for (...) if (...) ... ; else (...);` like you did in a few places, but not to add it everywhere.
> 
> I probably should've specified the warnings were from Clangd. The warnings were a lot of "Statement should be inside braces (fix available) [readability-braces-around-statement]"

That's in contradiction to LLVM's style (both years of convention, and I think we actually explicitly enumerated it not so long ago: https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements )- probably turn that check off when working with LLVM code.

https://github.com/llvm/llvm-project/pull/77956


More information about the llvm-commits mailing list