[CXX-1720] clang 7.0.1, Linux, c++14, libc++, ambiguous overload in change_stream.cpp Created: 30/Jan/19  Updated: 28/Oct/23  Resolved: 30/Mar/20

Status: Closed
Project: C++ Driver
Component/s: Build, Implementation
Affects Version/s: 3.4.0
Fix Version/s: 3.5.0

Type: Bug Priority: Major - P3
Reporter: Allan Bazinet Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux, clang 7.0.1, c+14, libc+


Backwards Compatibility: Fully Compatible

 Description   

When compiling on Linux, using the clang 7.0.1 compiler, std=c+14, stdlib=libc+, the build aborts on an ambiguous overload in change_stream.cpp, line 111:

out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", count));

Casting the second parameter allows the compile to proceed:

out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", static_cast<int64_t>(count)));



 Comments   
Comment by Allan Bazinet [ 30/Jan/19 ]

PR #641.

Comment by Kevin Albertson [ 30/Jan/19 ]

Hi Allan,

Thank you for the report! The integral representation of std::chrono::milliseconds is not specified beyond "signed integer type of at least 45 bits" (ref) and maxAwaitTimeMS is indeed intended to be an int64. Your proposed solution looks correct to me. Would you like to submit a pull request?

Thank you,
Kevin

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