mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
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:
parent
84898b4626
commit
c3fa333140
@ -1288,10 +1288,10 @@ class dynamic_arg_list {
|
||||
|
||||
public:
|
||||
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& value = node->value;
|
||||
node->next = std::move(head_);
|
||||
head_ = std::move(node);
|
||||
auto new_node = std::unique_ptr<typed_node<T>>(new typed_node<T>(arg));
|
||||
auto& value = new_node->value;
|
||||
new_node->next = std::move(head_);
|
||||
head_ = std::move(new_node);
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user