-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compatibility when using clang and libc++ #1852
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1852 +/- ##
==========================================
- Coverage 85.79% 85.77% -0.01%
==========================================
Files 171 171
Lines 5240 5240
==========================================
- Hits 4495 4494 -1
- Misses 745 746 +1
|
c656ae4
to
9381bb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the fix.
Since PR #1844 was merged here, please clarify how to merge to main:
- Merge this change, and drop PR 1844 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nicely done. Thanks. Also, please fix the merge conflict so it can be merged.
# include <type_traits> | ||
|
||
/** | ||
* @brief Clang 14.0.0 with libc++ do not support implicitly construct a span for a range.We just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief Clang 14.0.0 with libc++ do not support implicitly construct a span for a range.We just | |
* @brief Clang 14.0.0 with libc++ do not support implicitly construct a span for a range. We just |
Is this an issue for clang with libc++ 14.0.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, In my tests, clang with libc++ 14.0.1 do not has this problem, but if we install clang-14 through apt install clang-14 libc++-dev-14 libc++1-14 libc++abi-dev-14 libc++abi1-14
on Ubuntu 22.04, it will install 14.0.0 now(I run apt update
on 2022-12-09).
@@ -89,11 +89,13 @@ struct Uri | |||
class NoopEventHandler : public http_client::EventHandler | |||
{ | |||
public: | |||
void OnEvent(http_client::SessionState state, nostd::string_view reason) noexcept override {} | |||
void OnEvent(http_client::SessionState /* state */, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this introduced to workaround some compilation warning? Wrap the parameter name in inline comment seems more verbose than the original parameter there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, clang will trigger -Werror,-Wunused-parameter
when compiling with -Wextra -Werror
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed again after the latest merge.
Using env:
in ci.yml
is much better, thanks for the cleanup.
LGTM.
Signed-off-by: owent <[email protected]> Merge partly of open-telemetry#1844 Signed-off-by: owent <[email protected]> Update gtest to 1.12.1 by default Signed-off-by: owent <[email protected]> Fix compatibility when using clang and libc++ Signed-off-by: owent <[email protected]> No need build local gtest when using legacy toolchain. Signed-off-by: owent <[email protected]> Fix env in sudo Signed-off-by: owent <[email protected]> Add hint to print current C++ standard and stdlib for cmake. Signed-off-by: owent <[email protected]> Print output of C++ environment detection Signed-off-by: owent <[email protected]> Allow to set cxx flags by environments in CI jobs. Signed-off-by: owent <[email protected]> fix MAINTAINER_MODE: - bump gcc to version 12 - bump clang to version 14 - expand coverage on W3C tests Upgrade gootletest 1.12.1 Fixed new warnings. Fixed format, added changelog. Using fallback version of span when `std::span` do not support `range`. Signed-off-by: owent <[email protected]>
Signed-off-by: owent <[email protected]>
Signed-off-by: owent <[email protected]>
Signed-off-by: owent [email protected]
Fixes #1851
Changes
std::span
do not supportrange
.cmake.c++20.test
andcmake.c++20.stl.test
.(3.20.0
is the first version that support to add-std=c++20
to both gcc and clang.)ATOMIC_FLAG_INIT
usage when has__cpp_lib_atomic_value_initialization
. (C++20)-Werror
and it will cause compiling error on modern compilers.)-stdlib=libc++
.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes