gamesh411 marked 2 inline comments as done.
gamesh411 added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp:104
+  // Check whether the cast type is an enum.
+  const auto ED = dyn_cast_or_null<EnumDecl>(T->getAsTagDecl());
+  // If it is not an enum, we skip.
----------------
xazax.hun wrote:
> You could do something like T->getAs<EnumDecl>() directly without repeated 
> cast. 
Cannot get it with something like T->getAs<EnumDecl>() because T is a QualType, 
and it has an EnumDecl if it is an EnumeralType (note that it potentially has 
the Decl, not is the Decl). However the suggestion helped me refactor the 
method to make it more readable (see in the new diff).


https://reviews.llvm.org/D33672



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to