Skip to content

Commit 80b4dc0

Browse files
authored
remove ambiguous operator (#527)
* remove ambiguous operator * fix unit tests on gcc 10 and 11 * fix include ListenerStress * fix include for DomainParticipant Test * fix Conversions include * fix include FindDataWriter * fix include in FindDataReader * fix includes for Topic * fix includes
1 parent e3e9ecf commit 80b4dc0

18 files changed

+31
-7
lines changed

src/ddscxx/include/dds/core/detail/TInstanceHandleImpl.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,6 @@ inline std::ostream& operator << (std::ostream& os, const dds::core::TInstanceHa
108108
return os;
109109
}
110110

111-
//Overloaded operator << (workaround issues 252 and 162)
112-
inline std::ostream& operator << (std::ostream& os, const dds::core::TInstanceHandle<org::eclipse::cyclonedds::core::InstanceHandleDelegate> h)
113-
{
114-
os << h.delegate();
115-
return os;
116-
}
117-
118111
// End of implementation
119112

120113
#endif /* CYCLONEDDS_DDS_CORE_TINSTANCEHANDLE_IMPL_HPP_ */

src/ddscxx/tests/Condition.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include <gtest/gtest.h>
1213

1314
#include "dds/dds.hpp"

src/ddscxx/tests/Conversions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
12+
1113
#include <gtest/gtest.h>
1214

1315
#include "dds/dds.hpp"

src/ddscxx/tests/DataReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include <gtest/gtest.h>
1213

1314
#include "dds/dds.hpp"

src/ddscxx/tests/DataReaderManipulatorSelector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include <gtest/gtest.h>
1213

1314
#include "dds/dds.hpp"

src/ddscxx/tests/DataWriter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "Space.hpp"

src/ddscxx/tests/DomainParticipant.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "dds/ddsrt/environ.h"

src/ddscxx/tests/FindDataReader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
12+
1113
#include <iostream>
1214
#include <gtest/gtest.h>
1315

src/ddscxx/tests/FindDataWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
12+
1113
#include <iostream>
1214
#include <gtest/gtest.h>
1315

src/ddscxx/tests/FindTopic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "Space.hpp"

src/ddscxx/tests/ListenerStress.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <chrono>
1212
#include <thread>
1313

14+
#include "Util.hpp"
15+
1416
#include "dds/dds.hpp"
1517
#include "dds/ddsrt/sync.h"
1618
#include "dds/ddsrt/threads.h"

src/ddscxx/tests/Publisher.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "HelloWorldData.hpp"

src/ddscxx/tests/Qos.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314

src/ddscxx/tests/Query.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "Space.hpp"

src/ddscxx/tests/Regression.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/ddsrt/misc.h"
1213

1314
DDSRT_WARNING_GNUC_OFF(maybe-uninitialized)

src/ddscxx/tests/Subscriber.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "HelloWorldData.hpp"

src/ddscxx/tests/Topic.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//
99
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1010

11+
#include "Util.hpp"
1112
#include "dds/dds.hpp"
1213
#include <gtest/gtest.h>
1314
#include "Space.hpp"

src/ddscxx/tests/Util.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
#ifndef _TEST_UTIL_H
1212
#define _TEST_UTIL_H
1313

14+
#include "dds/dds.hpp"
15+
1416
#include <stdint.h>
1517
#include <stddef.h>
1618

1719
/* Get unique g_topic name on each invocation. */
1820
char *create_unique_topic_name (const char *prefix, char *name, size_t size);
1921

22+
/* I have no idea why gcc-10 and gcc-11 fail if this overload isn't available in the tests */
23+
#if defined __GNUC__ && __GNUC__ < 12
24+
inline std::ostream& operator << (std::ostream& os, const dds::core::TInstanceHandle<org::eclipse::cyclonedds::core::InstanceHandleDelegate> h)
25+
{
26+
os << h.delegate();
27+
return os;
28+
}
29+
#endif
30+
2031
#endif /* _TEST_UTIL_H */

0 commit comments

Comments
 (0)