================
@@ -976,8 +976,34 @@ static void DiagUninitUse(Sema &S, const VarDecl *VD, 
const UninitUse &Use,
                           bool IsCapturedByBlock) {
   bool Diagnosed = false;
 
+  // [basic.indet]/p1.1:
+  //  - If the object has dynamic storage duration, or is the object associated
+  //    with a variable or function parameter whose first declaration is marked
+  //    with the [[indeterminate]] attribute ([dcl.attr.indet]), the bytes have
+  //    indeterminate values;
+  //
+  //  - otherwise, the bytes have erroneous values, where each value is
+  //  determined
+  //    by the implementation independently of the state of the program.
+  //
+  // If variable has automatic storage duration and does
+  // not have [[indeterminate]], reading it is erroneous behavior (not
+  // undefined). However, we still warn about it.
+  bool IsErroneousBehavior = S.getLangOpts().CPlusPlus26 &&
----------------
erichkeane wrote:

```suggestion
  bool IsErroneousBehavior = 
```

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

Reply via email to