Skip to content

[BUG] BENCHMARK macros do not reference full namespace for make_unique #1959

Description

@pitrou

Describe the bug
In #1948 the various BENCHMARK macros were changed to something like:

#define BENCHMARK(...)                                                \
  BENCHMARK_PRIVATE_DECLARE(_benchmark_) =                            \
      (::benchmark::internal::RegisterBenchmarkInternal(              \
          benchmark::internal::make_unique<                           \
              ::benchmark::internal::FunctionBenchmark>(#__VA_ARGS__, \
                                                        __VA_ARGS__)))

This makes a relatively namespace lookup for benchmark::internal::make_unique even though the macros can be invoked from any namespace.

If the user code defined their own benchmark namespace, then the compiler fails finding make_unique. This produces errors in the Apache Arrow continuous benchmarking, for example here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions