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

unqualified call to 'std::move' #1163

Closed
raidenluikang opened this issue Mar 22, 2023 · 1 comment
Closed

unqualified call to 'std::move' #1163

raidenluikang opened this issue Mar 22, 2023 · 1 comment

Comments

@raidenluikang
Copy link

I just download sqlite_orm.h from master branch

raiden:Documents$ cat example.cpp

#include "sqlite_orm.h"



int main()
{


}

Build example.cpp with clang++ 15.0.7 generates a lot of warnings. This is not a problem with example code.

But, in my real project where sqlite_orm::storage defines a lot of columns, there hundred lines of warning for every single situation!
Could you fix it?

(*** Just do replace all unqualified move to std::move ***)

Thanks.

c++ -Wall -Wextra -Wpedantic -Wuninitialized -o "example" "example.cpp" -std=c++17 -O2 
In file included from example.cpp:2:
./sqlite_orm.h:2388:58: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), m, {}, std::make_tuple(constraints...)});
                                                         ^
                                                         std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:2404:58: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), getter, setter, std::make_tuple(constraints...)});
                                                         ^
                                                         std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:2421:58: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), getter, setter, std::make_tuple(constraints...)});
                                                         ^
                                                         std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:3272:42: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                order_by_base{asc_desc_, move(collate_argument_)}, name(move(name_)) {}
                                         ^
                                         std::
./sqlite_orm.h:3272:73: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                order_by_base{asc_desc_, move(collate_argument_)}, name(move(name_)) {}
                                                                        ^
                                                                        std::
./sqlite_orm.h:7117:18: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)), pk(pk_) {}
                 ^
                 std::
./sqlite_orm.h:7117:37: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)), pk(pk_) {}
                                    ^
                                    std::
./sqlite_orm.h:7117:81: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)), pk(pk_) {}
                                                                                ^
                                                                                std::
./sqlite_orm.h:7139:18: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)),
                 ^
                 std::
./sqlite_orm.h:7139:37: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)),
                                    ^
                                    std::
./sqlite_orm.h:7139:81: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            name(move(name_)), type(move(type_)), notnull(notnull_), dflt_value(move(dflt_value_)),
                                                                                ^
                                                                                std::
./sqlite_orm.h:7399:54: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return {internal::raise_t::type_t::rollback, move(message)};
                                                     ^
                                                     std::
./sqlite_orm.h:7406:51: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return {internal::raise_t::type_t::abort, move(message)};
                                                  ^
                                                  std::
./sqlite_orm.h:7413:50: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return {internal::raise_t::type_t::fail, move(message)};
                                                 ^
                                                 std::
./sqlite_orm.h:7418:58: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), std::move(part.base), std::move(part.statements)});
                                                         ^
                                                         std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:8785:39: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return quoteChar + sql_escape(move(v), quoteChar) + quoteChar;
                                      ^
                                      std::
./sqlite_orm.h:8794:52: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return std::string{char('x'), quoteChar} + move(v) + quoteChar;
                                                   ^
                                                   std::
./sqlite_orm.h:8803:39: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return quoteChar + sql_escape(move(identifier), quoteChar) + quoteChar;
                                      ^
                                      std::
./sqlite_orm.h:8985:39: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                res._collation_name = move(name);
                                      ^
                                      std::
./sqlite_orm.h:9063:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            return {move(name), false, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
                    ^
                    std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:9073:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            return {move(name), true, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
                    ^
                    std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:9453:44: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
                                           ^
                                           std::
./sqlite_orm.h:9453:74: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
                                                                         ^
                                                                         std::
./sqlite_orm.h:9454:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                run(move(run_)) {}
                    ^
                    std::
./sqlite_orm.h:9467:44: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
                                           ^
                                           std::
./sqlite_orm.h:9467:74: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
                                                                         ^
                                                                         std::
./sqlite_orm.h:9468:22: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                step(move(step_)), finalCall(move(finalCall_)) {}
                     ^
                     std::
./sqlite_orm.h:9468:46: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                step(move(step_)), finalCall(move(finalCall_)) {}
                                             ^
                                             std::
./sqlite_orm.h:10426:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            return {move(name), std::make_tuple<Cs...>(std::forward<Cs>(args)...)});
                    ^
                    std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:10437:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            return {move(name), std::make_tuple<Cs...>(std::forward<Cs>(args)...)});
                    ^
                    std::
./sqlite_orm.h:133:101: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES'
#define SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(...) SQLITE_ORM_CLANG_SUPPRESS("-Wmissing-braces", __VA_ARGS__)
                                                                                                    ^
./sqlite_orm.h:118:5: note: expanded from macro 'SQLITE_ORM_CLANG_SUPPRESS'
    __VA_ARGS__                                                                                                        \
    ^
./sqlite_orm.h:10818:76: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            iterator_t(statement_finalizer stmt_, view_type& view_) : stmt{move(stmt_)}, view{&view_} {
                                                                           ^
                                                                           std::
./sqlite_orm.h:10899:65: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            connection_holder(std::string filename_) : filename(move(filename_)) {}
                                                                ^
                                                                std::
./sqlite_orm.h:12595:25: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                return {move(stmt), *this};
                        ^
                        std::
./sqlite_orm.h:13088:31: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                res.push_back(move(rowString));
                              ^
                              std::
./sqlite_orm.h:13096:73: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            pragma_t(get_connection_t get_connection_) : get_connection(move(get_connection_)) {}
                                                                        ^
                                                                        std::
./sqlite_orm.h:13197:51: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk, hidden);
                                                  ^
                                                  std::
./sqlite_orm.h:13197:63: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk, hidden);
                                                              ^
                                                              std::
./sqlite_orm.h:13197:84: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk, hidden);
                                                                                   ^
                                                                                   std::
./sqlite_orm.h:13227:51: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk);
                                                  ^
                                                  std::
./sqlite_orm.h:13227:63: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk);
                                                              ^
                                                              std::
./sqlite_orm.h:13227:84: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                            res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk);
                                                                                   ^
                                                                                   std::
./sqlite_orm.h:13449:29: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                commit_func(move(commit_func_)), rollback_func(move(rollback_func_)) {}
                            ^
                            std::
./sqlite_orm.h:13449:64: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                commit_func(move(commit_func_)), rollback_func(move(rollback_func_)) {}
                                                               ^
                                                               std::
./sqlite_orm.h:13453:29: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                commit_func(move(other.commit_func)), rollback_func(move(other.rollback_func)),
                            ^
                            std::
./sqlite_orm.h:13453:69: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                commit_func(move(other.commit_func)), rollback_func(move(other.rollback_func)),
                                                                    ^
                                                                    std::
./sqlite_orm.h:13532:24: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                holder(move(holder_)), to(to_), from(from_) {
                       ^
                       std::
./sqlite_orm.h:13539:70: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                handle(std::exchange(other.handle, nullptr)), holder(move(other.holder)), to(other.to),
                                                                     ^
                                                                     std::
./sqlite_orm.h:13995:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                    move(name),
                    ^
                    std::
./sqlite_orm.h:14056:21: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                    move(name),
                    ^
                    std::
./sqlite_orm.h:14116:50: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                this->create_collation(ss.str(), move(func));
                                                 ^
                                                 std::
./sqlite_orm.h:14206:73: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                return {conRef, "main", this->get_connection(), "main", move(holder)};
                                                                        ^
                                                                        std::
./sqlite_orm.h:14216:73: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                return {this->get_connection(), "main", conRef, "main", move(holder)};
                                                                        ^
                                                                        std::
./sqlite_orm.h:14245:33: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                _busy_handler = move(handler);
                                ^
                                std::
./sqlite_orm.h:14262:64: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                connection(std::make_unique<connection_holder>(move(filename))),
                                                               ^
                                                               std::
./sqlite_orm.h:14765:87: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            table_name_collector(find_table_name_t find_table_name) : find_table_name{move(find_table_name)} {}
                                                                                      ^
                                                                                      std::
./sqlite_orm.h:14774:71: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                table_names.emplace(this->find_table_name(typeid(O)), move(alias));
                                                                      ^
                                                                      std::
./sqlite_orm.h:14791:41: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                    table_names.emplace(move(tableName), "");
                                        ^
                                        std::
./sqlite_orm.h:14806:37: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                table_names.emplace(move(tableName), alias_extractor<T>::get());
                                    ^
                                    std::
./sqlite_orm.h:17101:30: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                storage_base{move(filename), foreign_keys_count(dbObjects)}, db_objects{std::move(dbObjects)} {}
                             ^
                             std::
./sqlite_orm.h:17294:69: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                    rows = this->select(sqlite_orm::group_concat(m, move(*y)), std::forward<Args>(args)...);
                                                                    ^
                                                                    std::
./sqlite_orm.h:17299:28: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                    return move(rows.front());
                           ^
                           std::
./sqlite_orm.h:17497:82: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                                                   std::make_unique<std::string>(move(y)),
                                                                                 ^
                                                                                 std::
./sqlite_orm.h:17509:55: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                return this->group_concat_internal(m, move(str), std::forward<Args>(args)...);
                                                      ^
                                                      std::
./sqlite_orm.h:17810:30: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
                table.name = move(name);
                             ^
                             std::
./sqlite_orm.h:18449:17: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
        return {move(filename), internal::db_objects_tuple<DBO...>{std::forward<DBO>(dbObjects)...}};
                ^
                std::
./sqlite_orm.h:1366:56: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            unique_t(columns_tuple columns_) : columns(move(columns_)) {}
                                                       ^
                                                       std::
./sqlite_orm.h:1743:16: note: in instantiation of member function 'sqlite_orm::internal::unique_t<>::unique_t' requested here
        return {{}};
               ^
./sqlite_orm.h:1297:64: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call]
            primary_key_t(decltype(columns) columns) : columns(move(columns)) {}
                                                               ^
                                                               std::
./sqlite_orm.h:1760:16: note: in instantiation of member function 'sqlite_orm::internal::primary_key_t<>::primary_key_t' requested here
        return {{}};
               ^
67 warnings generated.
Compilation finished successfully.

@trueqbit
Copy link
Collaborator

This was fixed with PR #1130 and #1135. Please either use the dev branch, or wait a little until v1.8.2 is released.

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

No branches or pull requests

2 participants