[SERVER-15939] stagedbg_cmd.cpp does not compile with clang in C++03 mode Created: 04/Nov/14  Updated: 19/Nov/14  Resolved: 04/Nov/14

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.8.0-rc0

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Kaloian Manassiev
Resolution: Done Votes: 1
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-14462 db.currentOp doesn't report locking s... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

scons --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --cache build/cached/mongo/db/exec/stagedebug_cmd.o --c++11=off

Participants:

 Description   

If you build with clang but C++11 mode is not enabled (either because you are using too old a C++ standard library, or because you have suppressed C++11 with --c++11=off), then src/mongo/db/exec/stagedebug_cmd.cpp fails to compile due to a warning escalated to an error.



 Comments   
Comment by Andrew Morrow (Inactive) [ 04/Nov/14 ]

The generated error:

src/mongo/db/exec/stagedebug_cmd.cpp:190:49: error: C++98 requires an accessible copy constructor for class
      'mongo::WhereCallbackReal' when binding a reference to a temporary; was private [-Werror,-Wbind-to-temporary-copy]
                                        argObj, WhereCallbackReal(txn, collection->ns().db()));
                                                ^
src/mongo/db/matcher/expression_parser.h:178:32: note: declared private here
        MONGO_DISALLOW_COPYING(WhereCallbackReal);
                               ^
src/mongo/base/disallow_copying.h:44:5: note: expanded from macro 'MONGO_DISALLOW_COPYING'
    CLASS(const CLASS&);                        \
    ^
1 error generated.

Generated at Thu Feb 08 03:39:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.