================
@@ -1480,6 +1480,14 @@ class DeclRefExpr final
     return DeclRefExprBits.IsImmediateEscalating;
   }
 
+  bool isOverflowBehaviorDiscarded() const {
----------------
JustinStitt wrote:

The purpose is to emit a different diagnostic for when an OBT is lost during 
assignment.

```c
int __no_wrap a = 1;
int b = a + 13;

warning: implicit conversion from '__no_wrap int' to 'int' during assignment 
discards overflow behavior [-Wimplicit-overflow-behavior-conversion-assignment]
   11 |   int b = a + 13;
      |       ~   ~~^~~~
```

I've reworked this slightly in 
[8c875bb](https://github.com/llvm/llvm-project/pull/148914/commits/8c875bb1750c1f5fb1ac37ead58fb046501dd9f2).
 I moved the flag from `DeclRefExprBits` to `ExprBits` and added a comment. I 
also simplified the logic in `CheckOverflowBehaviorTypeConversion`.

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

Reply via email to