opencensus-cpp icon indicating copy to clipboard operation
opencensus-cpp copied to clipboard

Error compiling with clang 13

Open tzovas opened this issue 3 years ago • 0 comments

I get an error

external/io_opencensus_cpp/opencensus/exporters/stats/prometheus/prometheus_exporter.h:44:51: error: non-virtual member function marked 'override' hides virtual member function
  std::vector<prometheus::MetricFamily> Collect() override;
                                                  ^
bazel-out/darwin-fastbuild/bin/external/com_github_jupp0r_prometheus_cpp/core/_virtual_includes/core/prometheus/collectable.h:22:37: note: hidden overloaded virtual function 'prometheus::Collectable::Collect' declared here: different qualifiers ('const' vs unqualified)
  virtual std::vector<MetricFamily> Collect() const = 0;
                                    ^
external/io_opencensus_cpp/opencensus/exporters/stats/prometheus/prometheus_exporter.h:42:7: warning: abstract class is marked 'final' [-Wabstract-final-class]
class PrometheusExporter final : public ::prometheus::Collectable {
      ^
bazel-out/darwin-fastbuild/bin/external/com_github_jupp0r_prometheus_cpp/core/_virtual_includes/core/prometheus/collectable.h:22:37: note: unimplemented pure virtual method 'Collect' in 'PrometheusExporter'
  virtual std::vector<MetricFamily> Collect() const = 0;
                                    ^

A possible reason is that PrometheusExporter::Collect() is not marked as virtual.

tzovas avatar Mar 22 '22 14:03 tzovas