Skip to content

Build error: read-only reference ‘value’ used as ‘asm’ output #2343

@eyalroz

Description

@eyalroz

Describe your environment

  • SLES 15 SP 1
  • g++ 7.4.1
  • Kernel 4.12.14-195-default
  • googletest-1.14.0 manually downloaded built and installed under /opt/gtest
  • Google benchmark 1.8.3 manually downloaded built and installed under /opt/benchmark
  • CMake 3.27.1 manually downloaded and installed under
  • main branch, commit 0803e6a .

Steps to reproduce

  • Used CMake to configure
  • Used CMake to build

What is the expected behavior?

Build should have concluded successfully

What is the actual behavior?

During build, got the error:

In file included from /path/to/src/opentelemetry-cpp/sdk/test/trace/sampler_benchmark.cc:17:0:
/opt/benchmark/include/benchmark/benchmark.h: In instantiation of ‘typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type benchmark::DoNotOptimize(Tp&&) [with Tp = opentelemetry::v1::sdk::trace::ParentBasedSampler; typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type = void]’:
/path/to/src/opentelemetry-cpp/sdk/test/trace/sampler_benchmark.cc:49:85:   required from here
/opt/benchmark/include/benchmark/benchmark.h:540:46: error: read-only reference ‘value’ used as ‘asm’ output
   asm volatile("" : "+m"(value) : : "memory");
                                              ^
/opt/benchmark/include/benchmark/benchmark.h: In instantiation of ‘typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type benchmark::DoNotOptimize(Tp&&) [with Tp = opentelemetry::v1::sdk::trace::TraceIdRatioBasedSampler; typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type = void]’:
/path/to/src/opentelemetry-cpp/sdk/test/trace/sampler_benchmark.cc:58:60:   required from here
/opt/benchmark/include/benchmark/benchmark.h:540:46: error: read-only reference ‘value’ used as ‘asm’ output

Additional context

N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions