gribozavr wrote:

> @gribozavr see #102510 for alternative.

Thank you! We are looking at this now.

> That's not really true. You only need to upstream the AST affecting parts. 
> The attributes itself and AST node which represent it.

The attributes are already upstream (we are reusing nullability attributes 
added by Apple), as I explained above. The C++-compatible pragma is missing - 
and I expect it to be a lot of work to reconcile. And even then, we still need 
to propagate the annotations - which currently happens within the ClangTidy 
check.

For example, we need to understand that the template parameter 0 of 
`std::vector` variable below is nullable:

```c++
std::vector<absl::Nullable<int*>> MakeVectorOfNullable();

void Test() {
  std::vector<int*> xs = MakeVectorOfNullable();
  *xs[0]; // warning
}
```

This propagation could happen within core Clang so that it can be integrated 
into the resugarer that constructs the AST, but doing so (injecting nullable 
annotations here) would have its own cost for the AST, and would require 
rearchitecting the check, to essentially run part of the logic during AST 
construction instead of inside of ClangTidy.

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

Reply via email to