Skip to content

Commit

Permalink
Fixed ambigiuous lookup for symbol 'test'
Browse files Browse the repository at this point in the history
We use the namespace 'test' in this header which then breaks every
translation unit that also defines a test function, as defining
a namespace and a function with the same name doesn't work.

This patch gives this namespace a more unique name that we don't
run into this problem in the future.
  • Loading branch information
Teemperor committed Aug 27, 2017
1 parent 5ca2c40 commit a6aa50a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions FWCore/Utilities/interface/RunningAverage.h
Expand Up @@ -5,7 +5,7 @@
#include <array>

// Function for testing RunningAverage
namespace test {
namespace test_average {
namespace running_average {
int test();
}
Expand All @@ -16,7 +16,7 @@ namespace edm {
// thread safe, fast: does not garantee precise update in case of collision
class RunningAverage {
// For tests
friend int ::test::running_average::test();
friend int ::test_average::running_average::test();

public:
static constexpr int N = 16; // better be a power of 2
Expand Down
4 changes: 2 additions & 2 deletions FWCore/Utilities/test/RunningAverage_t.cpp
Expand Up @@ -15,7 +15,7 @@ namespace {
#include <algorithm>
#include <type_traits>

namespace test {
namespace test_average {
namespace running_average {
int test() {

Expand Down Expand Up @@ -74,5 +74,5 @@ namespace test {
}

int main() {
return ::test::running_average::test();
return ::test_average::running_average::test();
}

0 comments on commit a6aa50a

Please sign in to comment.