Skip to content
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

Compile error with GCC 11 WITH_STL=On #2026

Closed
tyler92 opened this issue Mar 7, 2023 · 1 comment · Fixed by #2025
Closed

Compile error with GCC 11 WITH_STL=On #2026

tyler92 opened this issue Mar 7, 2023 · 1 comment · Fixed by #2025
Labels
bug Something isn't working

Comments

@tyler92
Copy link
Contributor

tyler92 commented Mar 7, 2023

Describe your environment

gcc (Ubuntu 11.1.0-1ubuntu1~20.04) 11.1.0
cmake version 3.25.1
Ubuntu 20.04

Steps to reproduce

cmake -DBUILD_TESTING=OFF -DWITH_EXAMPLES_HTTP=ON -DWITH_PROMETHEUS=ON -DWITH_STL=ON ..
make

What is the expected behavior?

No compile errors

What is the actual behavior?

The following error:

In file included from opentelemetry-cpp/examples/http/client.cc:7:
opentelemetry-cpp/examples/http/tracer_common.h:29:26: error: expected ‘)’ before ‘&’ token
   29 |   HttpTextMapCarrier<T>(T &headers) : headers_(headers) {}

Additional context

https://godbolt.org/z/Pv3fqq7zx

@tyler92 tyler92 added the bug Something isn't working label Mar 7, 2023
@marcalff
Copy link
Member

marcalff commented Mar 7, 2023

Thanks for the report.

According to the compiler explorer link provided (thanks), the code:

  • build with GCC 11.3 with C++11, C++14, C++17
  • breaks with GCC 11.3 with C++20

which is probably why this did not get detected so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants