================
@@ -0,0 +1,47 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -verify 
%s
+
+// This test verifies that the analyzer can 'see' the initializer of an
+// array of structs, covering const, non-const, and main() vs non-main cases.
+
+void clang_analyzer_warnIfReached(void);
+
+struct S {
+  int a;
+};
+
+// Non-const struct array: initializer should be visible in main().
+struct S struct_array[1] = {
----------------
steakhal wrote:

I think I would prefer of encoding the constness into the variable name instead 
of a comment.
That way it appears: at the definition, and also at all uses. win-win.

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

Reply via email to