opentracing/opentracing-cpp

const noexcept override try

hennna opened this issue · 4 comments

I'm getting compilation error "expected ';' at end of declaration list" from the following line of code: https://github.com/opentracing/opentracing-cpp/blob/master/include/opentracing/tracer.h#L219

I'm not familiar with the expected behavior of this code. Is wrapping with curly braces an option?

void Apply(StartSpanOptions& options) const noexcept override {
 try {
    if (referenced_) options.references.emplace_back(type_, referenced_);
  } catch (const std::bad_alloc&) {
    // Ignore reference if memory can't be allocated for it.
  }
}

Curious, which compiler gives that error? It should be valid C++, but your snippet behaves the same so I'm fine changing to that.

I'm using google's internal version of bazel. I believe it uses clang.

Thanks.

There's CI coverage for clang, but I guess google must be using a different branch.

Fixed in #61