-
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
Build failure in nostd/span.h #2382
Comments
Investigating. A couple of comments: The syntax This is for example what I have in my
Please indicate:
Also, please indicate which .cc file fails to build, and whether:
In both cases, show the calling code that uses a span, causing this. Also, note that the patch is incorrect. It may build, but is unsafe, and will assign spans of incompatible objects U and size N to a span<T, Extent>, causing runtime crashes. |
Trying the following code, which is extracted from nostd::span in opentelemetry-cpp:
in compiler explorer (https://godbolt.org/) with Clang 16.0.0. The code builds properly for valid spans (s3), and fails as expected for invalid ones (s4). |
Thanks for the help @marcalff! "which C++ mode is used (C++11/14/17/20/23) when building."
Since span is not in C++17, it still uses nostd. "Also, please indicate which .cc file fails to build, and whether:"
In genSpan.h line 4, we have an include for tracer.h, and this class also creates an object of type std::shared_ptrbase::GenSpan... but the compiler throws a syntax error well before this. |
@esigo... what information is needed? |
@VivekSubr Based on the conversation during the community meeting, and indicated by @marcalff in above comment, the error couldn't be replicated. |
Closing, can not reproduce. |
Describe your environment
subramaniamv@a7e76fbbc22b:/src/cna$ clang --version
clang version 16.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Steps to reproduce
Install opentelemetry, and build using this compiler... you will get error,
Additional context
Looks like compound statements in enable_if is not getting accepted by clang, this patch gets it working ->
The text was updated successfully, but these errors were encountered: