Clang doesn't like deprecated ptr_fun in macOS

Description

It seems like when building this driver library under macOS, the clang comes with Xcode 11 doesn't like that this lib is using deprecated ptr_fun and no proper warning ignore flag is given

Environment

Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Xcode 11
maxOS 10.14.6 (18G103)
cmake version 3.14.5

Pull Requests

None

Activity

Show:
Michael Fero
November 2, 2019, 5:57 AM

std:tr_fun was deprecated in C++11 and std::not1 was deprecated in C++17. We may re-write the trim function to not use either of those standard functions in the near future, but for now it makes sense to simply disable those warnings.

Would you be able to apply the following patch and ensure this works for your use case?

Fredrik Slättman
November 2, 2019, 9:45 PM
Edited

Stumbled upon the same error with Clang (CPP-852).

Have created a PR with a proposed fix:

Michael Fero
November 3, 2019, 12:53 AM

Since we support older compilers we cannot utilize lambda functions as they are a C++11 feature and not all compilers support these features. For now I think the ignored deprecation for all platforms is the best approach.

, did ignoring the warnings as errors for the deprecated declarations not satisfy your use case?

Fixed

Assignee

Unassigned

Reporter

Fang-Pen Lin

Labels

None

PM Priority

None

Reproduced in

2.14.0

External issue ID

None

Doc Impact

None

Reviewer

Michael Penick

Size

None

Fix versions

Priority

Major