[clang] [Bounds Safety][NFC] Add some missing coverage for `-fexperimental-late-parse-attributes` (PR #102236)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 7 06:32:03 PDT 2024


================
@@ -80,10 +81,17 @@ struct found_outside_of_struct {
   struct bar ** ptr __counted_by_or_null(global); // expected-error {{field 'global' in 'counted_by_or_null' not inside structure}}
 };
 
+#ifndef LATE_PARSING_ENABLED
 struct self_referrential {
   int bork;
   struct bar *self[] __counted_by_or_null(self); // expected-error {{use of undeclared identifier 'self'}}
 };
+#else
+struct self_referrential {
+  int bork;
+  struct bar *self[] __counted_by_or_null(self); // expected-error {{'counted_by_or_null' only applies to pointers; did you mean to use 'counted_by'?}}
+};
+#endif
----------------
AaronBallman wrote:

Rather than duplicate the test, please use `-verify=whatever` to use different prefixes for the `expected-error` comments.

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


More information about the cfe-commits mailing list