mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Fix ODR violations in test code
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
int source();
|
||||
void sink(...) {};
|
||||
void sink(...);
|
||||
|
||||
class MyCopyableClass {
|
||||
public:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
int source();
|
||||
void sink(...) {};
|
||||
void sink(...);
|
||||
|
||||
class MyCopyableClassDeclOnly {
|
||||
public:
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
int v;
|
||||
};
|
||||
|
||||
void test_copyableclass()
|
||||
void test_copyableclass_declonly()
|
||||
{
|
||||
{
|
||||
MyCopyableClassDeclOnly s1(1);
|
||||
|
||||
@@ -30,7 +30,7 @@ int sscanf(const char *s, const char *format, ...);
|
||||
// ----------
|
||||
|
||||
int source();
|
||||
void sink(...) {};
|
||||
void sink(...);
|
||||
|
||||
namespace string
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
MyMovableClass getUnTainted() { return MyMovableClass(1); }
|
||||
MyMovableClass getTainted() { return MyMovableClass(source()); }
|
||||
|
||||
void test_copyableclass()
|
||||
void test_movableclass()
|
||||
{
|
||||
{
|
||||
MyMovableClass s1(1);
|
||||
|
||||
@@ -499,7 +499,7 @@ void test_string_iterator_methods()
|
||||
}
|
||||
}
|
||||
|
||||
void test_constructors_more() {
|
||||
void test_string_constructors_more() {
|
||||
char *cs1 = "abc";
|
||||
char *cs2 = source();
|
||||
std::string s1(cs1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
int source();
|
||||
void sink(...) {};
|
||||
void sink(...);
|
||||
|
||||
class StructLikeClass {
|
||||
public:
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace std
|
||||
template <class T>
|
||||
T &&move(T &t) noexcept { return static_cast<T &&>(t); } // simplified signature (and implementation)
|
||||
} // namespace std
|
||||
|
||||
namespace Swap1 {
|
||||
namespace IntWrapper
|
||||
{
|
||||
struct Class
|
||||
@@ -144,3 +144,5 @@ void test_move_assignment_method()
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace std
|
||||
template <class T>
|
||||
T &&move(T &t) noexcept { return static_cast<T &&>(t); } // simplified signature (and implementation)
|
||||
} // namespace std
|
||||
|
||||
namespace Swap2 {
|
||||
namespace IntWrapper
|
||||
{
|
||||
struct Class
|
||||
@@ -144,3 +144,5 @@ void test_move_assignment_method()
|
||||
sink(y.data1); // tainted
|
||||
sink(x.data1); // tainted
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
int source();
|
||||
void sink(...) {};
|
||||
void sink(...);
|
||||
|
||||
void arithAssignments(int source1, int clean1) {
|
||||
sink(clean1); // clean
|
||||
|
||||
@@ -312,7 +312,7 @@ void test_vector_insert() {
|
||||
sink(d); // tainted
|
||||
}
|
||||
|
||||
void test_constructors_more() {
|
||||
void test_vector_constructors_more() {
|
||||
std::vector<int> v1;
|
||||
std::vector<int> v2;
|
||||
v2.push_back(source());
|
||||
|
||||
Reference in New Issue
Block a user