https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110498
Michael Ragazzon <michael.ragazzon at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.ragazzon at gmail dot com --- Comment #1 from Michael Ragazzon <michael.ragazzon at gmail dot com> --- I seem to also have encountered this issue while using `std::vector<bool>`. Here is a relatively small reproducer. Compile with: -O3 -std=c++17 -Wall -Werror --- #include <stdio.h> #include <vector> class Testing { public: Testing(); private: std::vector<bool> elements; }; Testing::Testing() { // Warning emitted when set to any number in the range [1,64]. constexpr size_t reserve_size = 30; elements.reserve(reserve_size); elements.push_back(0); } int main() { Testing testing; } --- https://godbolt.org/z/eG66sjsPq This issue seems to have started with GCC 13.1, and exists also on current trunk (tested on Compiler Explorer).