[clang] [analyzer] Fix a crash from element region construction during `ArrayInitLoopExpr` analysis (PR #113570)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 10:16:57 PDT 2024


================
@@ -330,3 +330,41 @@ void no_crash() {
 }
 
 } // namespace crash
+
+namespace array_subscript_initializer {
+struct S {
+  int x;
+};
+
+void no_crash() {
+  S arr[][2] = {{1, 2}};
+
+  const auto [a, b] = arr[0]; // no-crash
----------------
isuckatcs wrote:

@steakhal `// no-crash` at the end of the line. Similarly in the other test case.

https://github.com/llvm/llvm-project/pull/113570


More information about the cfe-commits mailing list