Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-30 Thread Richard Smith via cfe-commits
On Dec 30, 2015 6:34 AM, "Aaron Ballman" wrote: > > aaron.ballman closed this revision. > aaron.ballman added a comment. > > Thanks! I've commit in r256643. > > > > Comment at: test/SemaCXX/warn-literal-conversion.cpp:49-50 > @@ +48,4 @@ > + // values. >

Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-30 Thread Aaron Ballman via cfe-commits
On Wed, Dec 30, 2015 at 12:30 PM, Richard Smith wrote: > On Dec 30, 2015 6:34 AM, "Aaron Ballman" wrote: >> >> aaron.ballman closed this revision. >> aaron.ballman added a comment. >> >> Thanks! I've commit in r256643. >> >> >> >>

Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-30 Thread Aaron Ballman via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. Thanks! I've commit in r256643. Comment at: test/SemaCXX/warn-literal-conversion.cpp:49-50 @@ +48,4 @@ + // values. + bool b3 = 0.0f; + bool b4 = 0.0; +} rsmith wrote: > What about > >

Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-29 Thread Richard Smith via cfe-commits
rsmith accepted this revision. This revision is now accepted and ready to land. Comment at: test/SemaCXX/warn-literal-conversion.cpp:49-50 @@ +48,4 @@ + // values. + bool b3 = 0.0f; + bool b4 = 0.0; +} What about bool b5 = 1.0; bool b6 = 2.0; ? Arguably

[PATCH] D15814: Implicit conversion from float->bool

2015-12-29 Thread Aaron Ballman via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: rsmith, rtrieu, dblaikie. aaron.ballman added a subscriber: cfe-commits. When performing an implicit from float to bool, the floating point value must be *exactly* zero in order for the conversion to result in 0. This does not

Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-29 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. This seems to me as specific case of Clang-tidy readability-implicit-bool-cast. May be this check should be entirely moved to Clang? http://reviews.llvm.org/D15814

Re: [PATCH] D15814: Implicit conversion from float->bool

2015-12-29 Thread Aaron Ballman via cfe-commits
aaron.ballman added a comment. In http://reviews.llvm.org/D15814#317879, @Eugene.Zelenko wrote: > This seems to me as specific case of Clang-tidy > readability-implicit-bool-cast. May be this check should be entirely moved to > Clang? I think the reason why that is in clang-tidy is because