================
@@ -2851,9 +2851,32 @@ ExprResult Sema::ActOnIdExpression(Scope *S, 
CXXScopeSpec &SS,
     // LookupName handles a name lookup from within anonymous struct.
     if (LookupName(R, S)) {
       if (auto *VD = dyn_cast<ValueDecl>(R.getFoundDecl())) {
+        // In C, fields inside bounds safety attributes (like __counted_by)
+        // are resolved as standalone identifiers. However, representing them
+        // as freestanding DeclRefExprs breaks downstream analyses (like 
Thread Safety).
+        // Instead, we synthesize a phantom CThisExpr and immediately build a 
+        // legally valid MemberExpr to represent the field access.
----------------
Caryoake wrote:

Yes i agree I have left that as is

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