Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-788

Number of 'const' qualifiers in return values

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.0.0-rc0
    • Affects Version/s: 0.2.0
    • Component/s: API
    • None

      In current master branch (currently checking cdf412bb6ea4692add71e00d39db60a9d5a61f97 commit) there is a number of const qualifiers on API functions which produces compilation warnings/errors

      /usr/include/mongocxx/v0.3/mongocxx/options/index.hpp:48:34: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
              MONGOCXX_PRIVATE virtual const int type() const = 0;
                                       ^~~~~~
      /usr/include/mongocxx/v0.3/mongocxx/options/index.hpp:75:26: error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]
              MONGOCXX_PRIVATE const int type() const override;
                               ^~~~~~
      

      I think the check for ignored qualifiers should be added to CI also since current version breaks application build with -Wall -Wextra -Werror flags.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            rayslava rayslava
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: