Skip to content

Commit d3a4e5c

Browse files
committed
C++: Fix DBCheck error caused by conflicting definitions in the test.
1 parent d529394 commit d3a4e5c

4 files changed

Lines changed: 120 additions & 71 deletions

File tree

‎cpp/ql/test/library-tests/dataflow/external-models/bal.cpp‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1+
#include "bsl.h"
12

23
// --- stub library headers ---
34

4-
namespace bsl {
5-
typedef unsigned long size_t;
6-
class streambuf {};
7-
class istream {};
8-
class ostream {};
9-
template <class T> class allocator {};
10-
template<class charT> struct char_traits {};
11-
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
12-
class basic_string {
13-
public:
14-
basic_string();
15-
basic_string(const charT* s, const Allocator& a = Allocator());
16-
const charT* data() const;
17-
size_t size() const;
18-
};
19-
typedef basic_string<char> string;
20-
}
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
2121

2222
namespace BloombergLP {
2323
namespace bdlar {

‎cpp/ql/test/library-tests/dataflow/external-models/bdlbb.cpp‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1+
#include "bsl.h"
12

23
// --- stub library headers ---
34

4-
namespace bsl {
5-
typedef unsigned long size_t;
6-
template <class T> class allocator {};
7-
template<class charT> struct char_traits {};
8-
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
9-
class basic_string {
10-
public:
11-
basic_string(const charT* s, const Allocator& a = Allocator());
12-
const charT* data() const;
13-
size_t size() const;
14-
};
15-
typedef basic_string<char> string;
16-
template <class T> class shared_ptr {
17-
public:
18-
T *get() const;
19-
};
20-
}
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
2121

2222
namespace BloombergLP {
2323
namespace bdlbb {

‎cpp/ql/test/library-tests/dataflow/external-models/bmqa.cpp‎

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1+
#include "bsl.h"
12

23
// --- stub library headers ---
34

4-
namespace bsl {
5-
typedef unsigned long size_t;
6-
typedef int int32_t;
7-
template <class T> class allocator {};
8-
template<class charT> struct char_traits {};
9-
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
10-
class basic_string {
11-
public:
12-
basic_string();
13-
basic_string(const charT* s, const Allocator& a = Allocator());
14-
const charT* data() const;
15-
size_t size() const;
16-
};
17-
typedef basic_string<char> string;
18-
template<class charT, class traits = char_traits<charT> >
19-
class basic_string_view {
20-
public:
21-
basic_string_view();
22-
basic_string_view(const charT* s);
23-
const charT* data() const;
24-
};
25-
typedef basic_string_view<char> string_view;
26-
template <class T, class Allocator = allocator<T> >
27-
class vector {
28-
public:
29-
vector();
30-
const T* data() const;
31-
const T& operator[](size_t i) const;
32-
void push_back(const T& value);
33-
};
34-
template <class T> class span {
35-
public:
36-
span();
37-
span(T* p, size_t n);
38-
T* data() const;
39-
};
40-
}
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
4141

4242
namespace BloombergLP {
4343
namespace bslma {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#ifndef CODEQL_TEST_BSL_STRING_H
2+
#define CODEQL_TEST_BSL_STRING_H
3+
4+
namespace bsl {
5+
typedef unsigned long size_t;
6+
typedef int int32_t;
7+
template <class T> class allocator {};
8+
template<class charT> struct char_traits {};
9+
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
10+
class basic_string {
11+
public:
12+
basic_string();
13+
basic_string(const charT* s, const Allocator& a = Allocator());
14+
const charT* data() const;
15+
size_t size() const;
16+
};
17+
typedef basic_string<char> string;
18+
template<class charT, class traits = char_traits<charT> >
19+
class basic_string_view {
20+
public:
21+
basic_string_view();
22+
basic_string_view(const charT* s);
23+
const charT* data() const;
24+
};
25+
typedef basic_string_view<char> string_view;
26+
template <class T, class Allocator = allocator<T> >
27+
class vector {
28+
public:
29+
vector();
30+
const T* data() const;
31+
const T& operator[](size_t i) const;
32+
void push_back(const T& value);
33+
};
34+
template <class T> class span {
35+
public:
36+
span();
37+
span(T* p, size_t n);
38+
T* data() const;
39+
};
40+
template <class T> class shared_ptr {
41+
public:
42+
T *get() const;
43+
};
44+
class streambuf {};
45+
class istream {};
46+
class ostream {};
47+
}
48+
49+
#endif

0 commit comments

Comments
 (0)