Code builds without -Wall, but not with -Wall

Bug #1992190 reported by Cristian Morales Vega
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-9 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

The following code

----------------------------------
#include <boost/safe_numerics/safe_integer.hpp>
#include <fmt/format.h>
#include <fmt/ostream.h>

template<typename Stored,
         Stored Min,
         Stored Max,
         typename P,
         typename E>
struct fmt::formatter<
    boost::safe_numerics::safe_base<
        Stored, Min, Max, P, E
    >
> : fmt::ostream_formatter
{
};

void test()
{
    fmt::print("{}", boost::safe_numerics::safe<int>{ 4 });
}
----------------------------------

, using fmt 9.1.0 and Boost 1.80, builds in Ubuntu 20.04, with the default gcc (9.4.0-1ubuntu1~20.04.1), when using "-std=gnu++17 -Os" but not when using "-std=gnu++17 -Os -Wall".

The problem also exists with g++-10 10.3.0-1ubuntu1~20.04.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Bug is not reproducible in kinetic with packaged versions of fmt and boost and g++ 12.

Given library versions are not shipped in 20.04.

Changed in gcc-9 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.