Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

readability-simplify-boolean-expr doesn't always work in included files #26331

Open Quuxplusone opened 8 years ago

Quuxplusone commented 8 years ago
Bugzilla Link PR26332
Status NEW
Importance P normal
Reported by Eugene Zelenko (eugene.zelenko@gmail.com)
Reported on 2016-01-26 17:20:13 -0800
Last modified on 2016-01-26 17:56:55 -0800
Version unspecified
Hardware PC Linux
CC alexfh@google.com, djasper@google.com, klimek@google.com, legalize@xmission.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also

When working with my work code base I noticed that readability-simplify-boolean-expr doesn't always work in included files (more precisely in inlined methods file included from header).

To reproduce this problem include readability-simplify-bool-expr.cpp in other source file and run Clang-tidy on it.

Looks like removing isExpansionInMainFile() from SimplifyBooleanExprCheck.cpp fix problem but I don't know why isExpansionInMainFile() was used at all.

Quuxplusone commented 8 years ago

Yes, isExpansionInMainFile() should be removed from the check. Clang-tidy takes care of filtering warnings by file.