[Bug 1992190] [NEW] Code builds without -Wall, but not with -Wall

Cristian Morales Vega 1992190 at bugs.launchpad.net
Fri Oct 7 17:06:38 UTC 2022


Public bug reported:

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.

** Affects: gcc-9 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-9 in Ubuntu.
https://bugs.launchpad.net/bugs/1992190

Title:
  Code builds without -Wall, but not with -Wall

Status in gcc-9 package in Ubuntu:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-9/+bug/1992190/+subscriptions




More information about the foundations-bugs mailing list