[PATCH] D85728: [Analyzer] Support for the new variadic isa<> and isa_and_not_null<> in CastValueChecker

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 06:48:11 PDT 2020


martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:270-272
+    default:
+      llvm_unreachable("Invalid template argument for isa<> or "
+                       "isa_and_nonnull<>");
----------------
baloghadamsoftware wrote:
> NoQ wrote:
> > We shouldn't crash when code under analysis doesn't match our expectation.
> The question is whether we can get any other template argument kind for `llvm::isa<>()` and `llvm::isa_and_nonnull<>()` than `Type` or `Pack`?
I think it is worth to ponder about the below case. What if `isa` is used in a dependent context (i.e. it is used inside another template)?
```
    /// The template argument is an expression, and we've not resolved it to one
    /// of the other forms yet, either because it's dependent or because we're
    /// representing a non-canonical template argument (for instance, in a
    /// TemplateSpecializationType).
    Expression,
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85728/new/

https://reviews.llvm.org/D85728



More information about the cfe-commits mailing list