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

mongocxx kvp std::string runtime error in visual studio 2019 release build.

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 3.7.2
    • Component/s: API, Build, Release
    • Labels:

      Summary

      I am using mongocxx in windows visual studio 2019.

      When i set std::string value in kvp function's first argument, rumtime error occur in release build.

      When i set const char array value in kvp function's first argument, it works without runtime error.

      How can i use std::string in kvp function's first argument without runtime error?

      Environment

      mongoc : 1.23.5

      mongocxx : 3.7.2

      OS : Windows 10 64-bit

      compiler : Visual studio 2019, version : 16.11.27

      How to Reproduce

      // Test is GTest

      TEST(MongoTest, AppendTest)

      {     std::string data\{ "abc" }

      ;
          make_document(kvp(data, "123"));
      }

      Additional Background

       

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            wshan@kabaminc.com Wansang Han [한완상]
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: