]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix -Wmaybe-uninitialized warning in another test
authorJonathan Wakely <jwakely@redhat.com>
Wed, 1 Oct 2025 12:51:55 +0000 (13:51 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 7 Oct 2025 11:12:45 +0000 (12:12 +0100)
Like r16-4120-ge1b9ccaa10df01 this is a false positive, but we can just
initialize the variable.

libstdc++-v3/ChangeLog:

* testsuite/std/time/parse/parse.cc: Initialize variable.

libstdc++-v3/testsuite/std/time/parse/parse.cc

index 8bb0fd0bebab1973a4be2e9054b61b73217ce779..78c761c115f6e009c188a33b0e2e57fbf08a4851 100644 (file)
@@ -309,7 +309,7 @@ test_modifiers()
   is >> parse("%5M", min);
   VERIFY( is.eof() && is.fail() );
 
-  std::chrono::seconds s;
+  std::chrono::seconds s{};
   is.clear();
   is.str("000000000012345");
   is >> parse("%12S", s); // Read more than 10 digits to check overflow logic.