================
@@ -9744,6 +9744,16 @@ static void DiagnoseNarrowingInInitList(Sema &S,
 
   case NK_Constant_Narrowing: {
     // A constant value was narrowed.
+
+    // Overflow behavior destination types with a 'wrap' kind can elide
----------------
JustinStitt wrote:

Check out `OverflowBehaviorTypes.rst`'s header regarding `C++ Narrowing 
Conversions`. The idea is that wrapping types are allowed to abuse wrap-around 
and intentional truncation/narrowing, we shouldn't warn in these cases.

```c
u32 a;
fun_stuff(&a);


// we are a power user, we've specified behavior for this u8.
u8 __wrap b = a; // potentially abuse truncation/narrowing without littering 
(u8) casts in places.
```

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

Reply via email to