================
@@ -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
----------------
ojhunt wrote:

No, you are misunderstanding the point of this diagnostic.

The error is not the wrapping behavior, it is the author getting the underlying 
type wrong.

e.g. the author wrote `uint32_t` when they meant to write `unint64_t`. The fact 
that they want the type to have defined wrapping semantics is irrelevant to 
that diagnosis.

> But yes, it is possible to write bad code, even when using OBTs.

Correct, and the literally entire point of this warning is to prevent this 
*exact* error.

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