-
Notifications
You must be signed in to change notification settings - Fork 417
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 compile with clang 16 and libc++ #2242
Fix compile with clang 16 and libc++ #2242
Conversation
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.
About the first issue:
I think the root cause is the forward declaration of LogRecordExporter.
Because of std::unique_ptr<LogRecordExporter>
, the compiler needs to see the LogRecordExporter destructor, and the header file that declares it.
Please try to include the header file for LogRecordExporter instead.
Per build logs in this PR:
Please add the following two lines:
and remove the matching forward declarations, Looks like unique_ptr is preventing to use forward declarations. |
The problem is
|
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2242 +/- ##
=======================================
Coverage 87.34% 87.34%
=======================================
Files 169 169
Lines 4902 4902
=======================================
Hits 4281 4281
Misses 621 621
|
Independently of forwards, I agree that moving code from *.h to *.cc is a good change in general. My concern is that, even when this fix the immediate issue, there might be more cases where the use of forward declarations with std::unique_ptr causes problems (this is specific to unique_ptr, shared_ptr is working properly and does not need to see the destructor of T). Revising every forward used in every std::unique_ptr will be a separate change anyway, to analyze in more details, so approving this change. |
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
Fixes #2241
Changes
SimpleLogRecordProcessor
into.cc
.std::vector::assign
to replacestd::fill
.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes