Skip to content

Get BOUT++ ready for C++20 (master)#3267

Open
dschwoerer wants to merge 6 commits intomasterfrom
c++20-master
Open

Get BOUT++ ready for C++20 (master)#3267
dschwoerer wants to merge 6 commits intomasterfrom
c++20-master

Conversation

@dschwoerer
Copy link
Contributor

No description provided.

dschwoerer and others added 6 commits February 3, 2026 13:33
Otherwise fmt tries to do compile-time checks, but fails as it cannot be
checked at compile time.
fmtlib/fmt#4179
With C++ std::accumulate uses std::move, which fails with the reference.
isatty is provided by both cpptrace and unistd.h, so we should only
include one.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

BoutException(const S& format, const Args&... args)
: BoutException(fmt::format(format, args...)) {}
BoutException(S&& format, Args&&... args)
: BoutException(fmt::format(fmt::runtime(std::forward<S>(format)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::runtime" is directly included [misc-include-cleaner]

include/bout/boutexception.hxx:10:

- #include "fmt/core.h"
+ #include "fmt/base.h"
+ #include "fmt/core.h"

template <class S, class... Args>
int push(const S& format, const Args&... args) {
return push(fmt::format(format, args...));
return push(fmt::format(fmt::runtime(format), args...));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]

    return push(fmt::format(fmt::runtime(format), args...));
                                         ^

template <class S, class... Args>
int push(const S& format, const Args&... args) {
return push(fmt::format(format, args...));
return push(fmt::format(fmt::runtime(format), args...));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::runtime" is directly included [misc-include-cleaner]

include/bout/msg_stack.hxx:26:

- class MsgStack;
+ #include "fmt/base.h"
+ class MsgStack;

template <class S, class... Args>
void read(Options* options, const S& format, const Args&... args) {
return read(options, fmt::format(format, args...));
return read(options, fmt::format(fmt::runtime(format), args...));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::runtime" is directly included [misc-include-cleaner]

include/bout/optionsreader.hxx:31:

- class OptionsReader;
+ #include "fmt/base.h"
+ class OptionsReader;


template <class S, class... Args>
Output(const S& format, const Args&... args) : Output(fmt::format(format, args...)) {}
Output(const S& format, const Args&... args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::runtime" is directly included [misc-include-cleaner]

include/bout/output.hxx:25:

- class Output;
+ #include "fmt/base.h"
+ class Output;

for (const auto& child : children) {
if (child.second.isValue()) {
fmt::format_to(ctx.out(), format_string, child.second);
fmt::format_to(ctx.out(), fmt::runtime(format_string), child.second);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::format_to" is directly included [misc-include-cleaner]

      fmt::format_to(ctx.out(), fmt::runtime(format_string), child.second);
           ^


// Call recursive function to write to file
fout << fmt::format("{:uds}", *options);
fout << fmt::format(fmt::runtime("{:uds}"), *options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::format" is directly included [misc-include-cleaner]

src/sys/options/options_ini.cxx:52:

- #include <bout/boutexception.hxx>
+ #include "fmt/format.h"
+ #include <bout/boutexception.hxx>


// Call recursive function to write to file
fout << fmt::format("{:uds}", *options);
fout << fmt::format(fmt::runtime("{:uds}"), *options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fmt::runtime" is directly included [misc-include-cleaner]

src/sys/options/options_ini.cxx:52:

- #include <bout/boutexception.hxx>
+ #include "fmt/base.h"
+ #include <bout/boutexception.hxx>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant