zygoloid wrote:

As mentioned in the comment thread, I'd prefer to see this addressed by 
reversing the order in which we call `addDecl` versus add an offset. While it's 
a corner case, I think this change would cause us to start rejecting things 
like [this example](https://godbolt.org/z/5Pae6Ghd7) where we form a non-null 
pointer with no base in a constant-folded region. Currently, the subsequent 
member access (`->hardware_register_1`) is accepted, because it's not accessing 
a member of a null pointer -- it's accessing a member of an integral non-null 
pointer.

I don't know how important things like this example are, but they do at least 
seem useful in some cases.

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

Reply via email to