[CXX-155] rotatable_file_writer_test does not compile in C++11 mode with libc++ Created: 26/Mar/14  Updated: 04/May/14  Resolved: 28/Mar/14

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: legacy-0.8.0

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: c++11, legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CXX-196 26compat rotatable_file_writer_test d... Closed

 Description   

Using this build line on OS X Mavericks with XCode 5.1:

scons --cache --libc++ --osx-version-min=10.8 --sharedclient --prefix=/Users/andrew/Documents/10gen/dev/src/mongo-client-install --ssl --use-sasl-client --dbg=on --opt=on --extrapath=/opt/local --c++11 -j10 --mute . -k

The test fails to compile as follows:

Compiling build/cached/mongo/logger/rotatable_file_writer_test.o
src/mongo/logger/rotatable_file_writer_test.cpp:52:13: error: no matching conversion for
      functional-style cast from 'std::__1::basic_ostream<char>' to '::testing::AssertionResult'
            ASSERT_TRUE(writerUse.stream() << "Level 1 message." << std::endl);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/third_party/gtest-1.7.0/include/gtest/gtest.h:1921:3: note: expanded from macro 'ASSERT_TRUE'
  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/third_party/gtest-1.7.0/include/gtest/internal/gtest-internal.h:1111:7: note: expanded from
      macro 'GTEST_TEST_BOOLEAN_'
      ::testing::AssertionResult(expression)) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/third_party/gtest-1.7.0/include/gtest/gtest.h:260:3: note: candidate constructor not viable: no
      known conversion from 'std::__1::basic_ostream<char>' to 'const testing::AssertionResult' for
      1st argument
  AssertionResult(const AssertionResult& other);
  ^
src/third_party/gtest-1.7.0/include/gtest/gtest.h:262:12: note: candidate constructor not viable: no
      known conversion from 'std::__1::basic_ostream<char>' to 'bool' for 1st argument
  explicit AssertionResult(bool success) : success_(success) {}
           ^
src/mongo/logger/rotatable_file_writer_test.cpp:53:13: error: no matching conversion for
      functional-style cast from 'std::__1::basic_ostream<char>' to '::testing::AssertionResult'
            ASSERT_TRUE(writerUse.stream() << "Level 2 message." << std::endl);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
....



 Comments   
Comment by Githook User [ 22/Apr/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-196 CXX-155 Force construction of bool to deal with explicit operator bool on streams

(cherry picked from commit 9f28c088968e920625cb84b00362d8f7398f486c)
Branch: 26compat
https://github.com/mongodb/mongo-cxx-driver/commit/e2ee676799ead4eaab2f7eb6cca96384c92fc2b9

Comment by Githook User [ 28/Mar/14 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-155 Force construction of bool to deal with explicit operator bool on streams
Branch: legacy
https://github.com/mongodb/mongo-cxx-driver/commit/9f28c088968e920625cb84b00362d8f7398f486c

Comment by Andrew Morrow (Inactive) [ 28/Mar/14 ]

https://github.com/mongodb/mongo-cxx-driver/pull/41

Generated at Wed Feb 07 21:58:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.