AaronBallman wrote:

> But actually I was sceptical about a different thing.

Thanks for clarifying!

> > If i understand it right, that particular conditional statement should get 
> > executed for this:
> 
> ```c
> int main() { 
>     int var1 = 63;
>     int out = var; 
> } 
> ```
> 
> > and should be skipped for:
> 
> ```c
> int main(){
>     int var1 = 63;
>     int out = notFound;
> }
> ```
> 
> > but the problem is that the conditional statement gets executed for both 
> > the cases, so when i put the new check somewhere below it, the control 
> > never reaches the new check.
> > please correct me if i'm off somewhere :)
> 
> This was my actual concern, but this behaviour seems unpredictable, sometimes 
> happens and sometimes doesn't, but in either cases no identifiers were near 
> to eachother.

If you're talking about 
https://github.com/llvm/llvm-project/blob/cb3498c6704daefc6e5221beb757126765737aa7/clang/lib/Sema/SemaExpr.cpp#L2527,
 I would expect that condition to be true for both code examples because there 
is a scope (the body of `main`) and there is a `TypoExpr **` passed in from the 
caller. Am I looking at the right condition? If so, I'm not certain I 
understand what's unpredictable yet.


https://github.com/llvm/llvm-project/pull/123495
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to