]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: adjust testcase to reveal failure [PR107919]
authorJason Merrill <jason@redhat.com>
Fri, 6 Sep 2024 19:14:33 +0000 (15:14 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 6 Sep 2024 19:29:11 +0000 (15:29 -0400)
This test appeared to be passing, but only because the warning was
suppressed by #pragma system_header.

PR tree-optimization/107919

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wuninitialized-pr107919-1.C: Add -Wsystem-headers and
xfail.

gcc/testsuite/g++.dg/warn/Wuninitialized-pr107919-1.C

index 067a44a462e1fe93cc79a76d50478458123c6d13..049fa4d307ae956bc5a535011463594a8082ee44 100644 (file)
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-require-effective-target c++17 }
-// { dg-options "-O2 -Wuninitialized" }
+// { dg-options "-O2 -Wuninitialized -Wsystem-headers" }
 
 #include <memory>
 #include <variant>
@@ -13,3 +13,5 @@ void do_something(void* storage)
   auto& swappedValue = *reinterpret_cast<Event*>(storage);
   std::swap(event, swappedValue);
 }
+
+// { dg-bogus "may be used uninitialized" "" { xfail *-*-* } 0 }