================
@@ -4334,6 +4345,7 @@ bool Expr::isSameComparisonOperand(const Expr* E1, const 
Expr* E2) {
   switch (E1->getStmtClass()) {
     default:
       return false;
+    case CThisExprClass:
     case CXXThisExprClass:
----------------
Caryoake wrote:

An appropriate example could be :-

struct Buffer {
    int size;
    int* data __counted_by(size == size ? size : 0); 
};

Here when Clang sees size  == size, it will implictly resolves both sides to 
CThis->size.
So to determine if both are identical, it will recurse down to the base,  hit 
the CThisExprCase, return true (like CXXThisExprClass) and will then recognise 
both the pseudo pointers refer to the same implicit struct instance.

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

Reply via email to