Skip to content

Commit 372fd8f

Browse files
Fix stubs to add std::set back, and std::less
1 parent dd8135c commit 372fd8f

File tree

11 files changed

+39
-25
lines changed

11 files changed

+39
-25
lines changed

cpp/common/test/includes/standard-library/deque.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _GHLIBCPP_DEQUE
33
#include <iterator>
44
#include <string>
5+
#include "memory.h"
56

67
namespace std {
78
template <class T, class Allocator = std::allocator<T>> class deque {

cpp/common/test/includes/standard-library/functional.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,21 @@ template <class R, class... Args> class function<R(Args...)> {
9090
template <class F> function(F &&);
9191
template <class F> function &operator=(F &&);
9292
};
93+
94+
template <typename T>
95+
struct less {
96+
bool operator()(const T &x, const T &y) const;
97+
typedef T first_argument_type;
98+
typedef T second_argument_type;
99+
typedef bool result_type;
100+
};
101+
102+
template <typename T>
103+
struct greater {
104+
bool operator()(const T &x, const T &y) const;
105+
typedef T first_argument_type;
106+
typedef T second_argument_type;
107+
typedef bool result_type;
108+
};
93109
} // namespace std
94110
#endif

cpp/common/test/includes/standard-library/iosfwd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ifndef _GHLIBCPP_IOSFWD
22
#define _GHLIBCPP_IOSFWD
3+
#include "memory.h"
34
namespace std {
45
template <class charT> class char_traits;
56
template <> class char_traits<char>;

cpp/common/test/includes/standard-library/map

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "iterator.h"
2-
#include <bits/stl_function.h>
2+
#include "memory.h"
3+
#include "functional.h"
34

45
namespace std {
56

cpp/common/test/includes/standard-library/memory.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ class bad_alloc : public exception {
128128
bad_alloc &operator=(const bad_alloc &) noexcept;
129129
virtual const char *what() const noexcept;
130130
};
131+
132+
template <class T> class allocator {
133+
public:
134+
allocator() throw();
135+
typedef size_t size_type;
136+
};
131137
} // namespace std
132138

133139
#endif // _GHLIBCPP_MEMORY

cpp/common/test/includes/standard-library/set

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "iterator.h"
2-
#include <bits/stl_function.h>
2+
#include "memory.h"
3+
#include "functional.h"
34

45
namespace std {
56
template <typename _Key, typename _Compare = std::less<_Key>,

cpp/common/test/includes/standard-library/string

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _GHLIBCPP_STRING
22
#define _GHLIBCPP_STRING
33
#include "cwchar"
4+
#include "memory.h"
45
#include "initializer_list"
56
#include "ios.h"
67
#include "iosfwd.h"
@@ -88,12 +89,6 @@ template <> struct char_traits<wchar_t> {
8889
static int_type eof();
8990
};
9091

91-
template <class T> class allocator {
92-
public:
93-
allocator() throw();
94-
typedef size_t size_type;
95-
};
96-
9792
template <class charT, class traits = char_traits<charT>,
9893
class Allocator = allocator<charT>>
9994
class basic_string {

cpp/common/test/includes/standard-library/vector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _GHLIBCPP_VECTOR
33
#include <iterator>
44
#include <string>
5+
#include "memory.h"
56

67
namespace std {
78

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
| test.cpp:21:3:21:11 | call to sort | Predicate usage of $@ has $@ | test.cpp:10:8:10:9 | F1 | callable object F1 | test.cpp:11:8:11:17 | operator() | non const operator(). |
1+
| test.cpp:15:8:15:10 | type mention | Predicate usage of $@ has $@ | test.cpp:10:8:10:9 | F1 | callable object F1 | test.cpp:11:8:11:17 | operator() | non const operator(). |
2+
| test.cpp:20:3:20:11 | call to sort | Predicate usage of $@ has $@ | test.cpp:10:8:10:9 | F1 | callable object F1 | test.cpp:11:8:11:17 | operator() | non const operator(). |
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.cpp:60:35:60:49 | cmp_with_static | Predicate $@ has a $@. | test.cpp:52:6:52:20 | cmp_with_static | cmp_with_static | test.cpp:54:3:54:11 | ++ ... | persistent side effect |
2-
| test.cpp:73:35:73:49 | cmp_with_global | Predicate $@ has a $@. | test.cpp:66:6:66:20 | cmp_with_global | cmp_with_global | test.cpp:67:3:67:26 | ++ ... | persistent side effect |
3-
| test.cpp:86:3:86:11 | call to sort | Predicate $@ has a $@. | test.cpp:78:8:78:17 | operator() | operator() | test.cpp:79:5:79:28 | ++ ... | persistent side effect |
1+
| test.cpp:51:35:51:49 | cmp_with_static | Predicate $@ has a $@. | test.cpp:43:6:43:20 | cmp_with_static | cmp_with_static | test.cpp:45:3:45:11 | ++ ... | persistent side effect |
2+
| test.cpp:64:35:64:49 | cmp_with_global | Predicate $@ has a $@. | test.cpp:57:6:57:20 | cmp_with_global | cmp_with_global | test.cpp:58:3:58:26 | ++ ... | persistent side effect |
3+
| test.cpp:77:3:77:11 | call to sort | Predicate $@ has a $@. | test.cpp:69:8:69:17 | operator() | operator() | test.cpp:70:5:70:28 | ++ ... | persistent side effect |

0 commit comments

Comments
 (0)