Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings for compilers with EDG frontend #3196

Merged
merged 2 commits into from
Nov 22, 2022
Merged

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Nov 19, 2022

1) warning: a class type that is not trivially copyable passed through ellipsis (EDG frontend)

lcc: "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/core.h", line 1670: warning #1290:
          a class type that is not trivially copyable passed through ellipsis
      return vis(sv(arg.value_.string.data, arg.value_.string.size));
                 ^
          detected during:
            instantiation of
                      "auto fmt::v9::visit_format_arg(Visitor &&, const fmt::v9::basic_format_arg<Context> &)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char> &, Context=fmt::v9::format_context]"
                      at line 1022 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format.h"
            instantiation of
                      "auto fmt::v9::loc_value::visit(Visitor &&)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char>]"
                      at line 146 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format-inl.h"

lcc: "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/core.h", line 1674: warning #1290:
          a class type that is not trivially copyable passed through ellipsis
      return vis(typename basic_format_arg<Context>::handle(arg.value_.custom));
                 ^
          detected during:
            instantiation of
                      "auto fmt::v9::visit_format_arg(Visitor &&, const fmt::v9::basic_format_arg<Context> &)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char> &, Context=fmt::v9::format_context]"
                      at line 1022 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format.h"
            instantiation of
                      "auto fmt::v9::loc_value::visit(Visitor &&)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char>]"
                      at line 146 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format-inl.h"

lcc: "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/core.h", line 1676: warning #1290:
          a class type that is not trivially copyable passed through ellipsis
    return vis(monostate());
               ^
          detected during:
            instantiation of
                      "auto fmt::v9::visit_format_arg(Visitor &&, const fmt::v9::basic_format_arg<Context> &)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char> &, Context=fmt::v9::format_context]"
                      at line 1022 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format.h"
            instantiation of
                      "auto fmt::v9::loc_value::visit(Visitor &&)->decltype((<expression>)) [with Visitor=fmt::v9::detail::loc_writer<char>]"
                      at line 146 of
                      "/export/home/phprus/fmt/fmt-hexfloat-1/include/fmt/format-inl.h"

Passing a non-trivially copyable class via ... is not allowed:

Only arithmetic, enumeration, pointer, pointer to member, and class type arguments (after conversion) are allowed. However, non-POD class types (until C++11)class types with an eligible non-trivial copy constructor, an eligible non-trivial move constructor, or a non-trivial destructor, together with scoped enumerations (since C++11), are conditionally-supported in potentially-evaluated calls with implementation-defined semantics (these types are always supported in unevaluated calls).

See: https://en.cppreference.com/w/cpp/language/variadic_arguments

2) warning: the implicit by-copy capture of "this" is deprecated (EDG frontend)

lcc: "/export/home/phprus/fmt/fmt-hexfloat-1/test/gtest/gmock-gtest-all.cc", line 13783: warning #2908:
          the implicit by-copy capture of "this" is deprecated
                 ? this->UntypedPerformDefaultAction(untyped_args, ss.str())
                   ^

I think it's a bug in the compiler or EDG frontend.

…gh ellipsis (EDG frontend)

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
…G frontend)

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
@vitaut vitaut merged commit 8276f1a into fmtlib:master Nov 22, 2022
@vitaut
Copy link
Contributor

vitaut commented Nov 22, 2022

Thanks!

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.

2 participants