================
@@ -4852,6 +4862,10 @@ BinaryOperator::BinaryOperator(const ASTContext &Ctx, 
Expr *lhs, Expr *rhs,
   if (hasStoredFPFeatures())
     setStoredFPFeatures(FPFeatures);
   setDependence(computeDependence(this));
+  if (hasWrappingOperand(Ctx))
----------------
JustinStitt wrote:

Implementation-wise, it is OK for both attributes to exist on the same type.

`hasWrapsAttr()` cautiously checks for `no_wraps` before claiming we have 
`wraps`.
```c
bool QualType::hasWrapsAttr() const {
  return !isNull() && getTypePtr()->hasAttr(attr::Wraps) &&
         !getTypePtr()->hasAttr(attr::NoWraps);
}

```

But yeah you're right, this is confusing because if you look at an ast dump 
you'll see both attributes applied to the type and it may not be obvious which 
has precedence. I'll add a diagnostic and a sane default of keeping the 
`no_wraps` and dropping `wraps` for cases like this.

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

Reply via email to