================
@@ -321,9 +321,10 @@ void f(std::vector<int>& t) {
   }
   {
     FooProto foo;
-    // CHECK-FIXES-NOT: foo.mutable_x()->Reserve(5);
+    // CHECK-FIXES: foo.mutable_x()->Reserve(5);
     for (int i = 0; i < 5; i++) {
       foo.add_x(i);
+      // CHECK-MESSAGES: :[[@LINE-1]]:7: warning: 'add_x' is called inside a 
loop
       foo.add_x(i);
     }
   }
----------------
vbvictor wrote:

This is cleary a bug, you reserve 5, but make 10 push-backs.

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

Reply via email to