Remove warning in core.h with when compiling with gcc and -Wshadow

In file included from build/_deps/fmt-src/include/fmt/format.h:44:0,
                 from src/main.cpp:5:
build/_deps/fmt-src/include/fmt/core.h: In member function ‘const T& fmt::v6::internal::dynamic_arg_list::push(const Arg&)’:
build/_deps/fmt-src/include/fmt/core.h:1256:10: error: declaration of ‘node’ shadows a member of ‘fmt::v6::internal::dynamic_arg_list’ [-Werror=shadow]
     auto node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
          ^~~~
build/_deps/fmt-src/include/fmt/core.h:1236:37: note: shadowed declaration is here
   template <typename = void> struct node {
This commit is contained in:
Johan Norberg 2020-04-11 20:16:45 +02:00
parent 9505bdd852
commit f660d92033

View File

@ -1253,10 +1253,10 @@ class dynamic_arg_list {
public: public:
template <typename T, typename Arg> const T& push(const Arg& arg) { template <typename T, typename Arg> const T& push(const Arg& arg) {
auto node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg)); auto node_ = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
auto& value = node->value; auto& value = node_->value;
node->next = std::move(head_); node_->next = std::move(head_);
head_ = std::move(node); head_ = std::move(node_);
return value; return value;
} }
}; };