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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 17 12:57:56 PDT 2018


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 = Result.Nodes.getNodeAs<NamedDecl>("decl")) {
      if (!Decl->getIdentifier() || Decl->getName().empty() || Decl->isImplicit())
        return;
  
  ...
      StyleKind SK = findStyleKind(Decl, NamingStyles);
      if (SK == SK_Invalid)
        return;
  ...
   }


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52179





More information about the cfe-commits mailing list