ziqingluo-90 wrote:

> It would be nice if we just skipped dependent expressions rather than 
> disregarding the entire thing, and I'd also like to include a test to ensure 
> that we don't skip diagnostics when a function in a dependent context is not 
> actually dependent, 
> and the other tests being added should also verify instantiation produces 
> diagnostics.

@ojhunt As background, these `Extractor` classes are not for a specific 
diagnostic or analysis. Their duty is to collect facts about specific aspects 
of the source code. Those facts may be used by various clients, e.g., analyzers 
or source-code editing tools. In addition, this is a part of the SSAF 
framework, which analyzes the entire project(s) as its "whole world".

Under this assumption, my opinion is that we do not reason about properties of 
the template itself but of all of its instantiations. A rough analogy is 
reasoning about `Forall T. P(T)` vs. `Forall T in {a, b, ...}. P(T)`, where 
`{a, b, ...}` is the finite set of concrete types with which `T` is 
instantiated.  Since the instantiations are collected from the "whole world", 
the latter is sufficient and simple to reason about.

WDYT?




https://github.com/llvm/llvm-project/pull/198927
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to