StarOne01 wrote:

> 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.

Sorry for the confusion, I referred to this conditional statement 
(https://github.com/llvm/llvm-project/blob/main/clang%2Flib%2FSema%2FSemaExpr.cpp#L2525-L2526).

To demonstrate the uncertain behaviour, let's take a testcase which @shafik 
suggested.

When we track the value of `*out` pointer though the code, we could see that.

```c
#define F() 66
int x = F;  // This 'F' seems make the `*out` non-null

void g(int);

void f() {
    F + 1; // but this 'F' seems to have `*out` ptr null
    g(F);  // this one makes  the `*out` ptr non-null 
}
```

Even though `F` shouldn't have a typocorrection, given the context.


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