[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-18 Thread Artem Belevich via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE342514: [clang-tidy] Replace redundant checks with an assert(). (authored by tra, committed by ). Changed prior to commit: https://reviews.llvm.org/D52179?vs=165841=166042#toc Repository: rCTE

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:551-552 if (Decl->isMain() || !Decl->isUserProvided() || -

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:388 ) { + assert(D && D->getIdentifier() && !D->getName().empty() && !D->isImplicit() && + "Decl must be an explicit identifier with a name.");

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Artem Belevich via Phabricator via cfe-commits
tra marked an inline comment as done. tra added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:551-552 if (Decl->isMain() || !Decl->isUserProvided() || -Decl->isUsualDeallocationFunction() || -

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Artem Belevich via Phabricator via cfe-commits
tra updated this revision to Diff 165841. tra added a comment. - Check that D is non-null https://reviews.llvm.org/D52179 Files: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp:388 ) { + assert(D->getIdentifier() && !D->getName().empty() && !D->isImplicit() && + "Decl must be an explicit identifier with a name.");

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D52179#1237194, @JonasToth wrote: > Is the condition for this assertion checked beforehand or could this create > runtime failures? It's checked by the (only) caller of the function on line 791: if (const auto *Decl =

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Is the condition for this assertion checked beforehand or could this create runtime failures? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52179 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52179: [clang-tidy] Replace redundant checks with an assert().

2018-09-17 Thread Artem Belevich via Phabricator via cfe-commits
tra created this revision. tra added reviewers: alexfh, rsmith. Herald added subscribers: bixia, xazax.hun, jlebar, sanjoy. findStyleKind is only called if D is an explicit identifier with a name, so the checks for operators will never return true. The explicit assert() enforces this invariant.