diff --git a/api/include/opentelemetry/trace/span_context.h b/api/include/opentelemetry/trace/span_context.h index ca13a8df60..e19bb99001 100644 --- a/api/include/opentelemetry/trace/span_context.h +++ b/api/include/opentelemetry/trace/span_context.h @@ -81,7 +81,7 @@ class SpanContext final bool IsRemote() const noexcept { return is_remote_; } - static SpanContext GetInvalid() { return SpanContext(false, false); } + static SpanContext GetInvalid() noexcept { return SpanContext(false, false); } bool IsSampled() const noexcept { return trace_flags_.IsSampled(); } diff --git a/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h b/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h index 04ad86130f..3cf365c8a0 100644 --- a/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h +++ b/exporters/etw/include/opentelemetry/exporters/etw/etw_properties.h @@ -192,7 +192,7 @@ class PropertyValue : public PropertyVariant {} /** - * @brief Convert owning PropertyValue to non-owning common::AttributeValue + * @brief Convert non-owning common::AttributeValue to owning PropertyValue. * @return */ PropertyValue &FromAttributeValue(const common::AttributeValue &v) @@ -222,7 +222,8 @@ class PropertyValue : public PropertyVariant break; } case common::AttributeType::kTypeString: { - PropertyVariant::operator=(nostd::string_view(nostd::get(v)).data()); + PropertyVariant::operator= + (std::string{nostd::string_view(nostd::get(v)).data()}); break; }