Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b6096e

Browse files
committed
C++: Define make_pair and declare std::forward in the test.
1 parent ad9f306 commit 0b6096e

2 files changed

Lines changed: 150 additions & 26 deletions

File tree

cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected

Lines changed: 141 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,31 +1931,147 @@
19311931
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:53:12:53:18 | source1 | |
19321932
| standalone_iterators.cpp:51:37:51:43 | source1 | standalone_iterators.cpp:54:14:54:20 | source1 | |
19331933
| standalone_iterators.cpp:53:12:53:18 | ref arg source1 | standalone_iterators.cpp:54:14:54:20 | source1 | |
1934-
| stl.h:235:30:235:40 | call to allocator | stl.h:235:21:235:41 | noexcept(...) | TAINT |
1935-
| stl.h:235:30:235:40 | call to allocator | stl.h:235:21:235:41 | noexcept(...) | TAINT |
1936-
| stl.h:235:30:235:40 | call to allocator | stl.h:235:21:235:41 | noexcept(...) | TAINT |
1937-
| stl.h:235:30:235:40 | call to allocator | stl.h:235:21:235:41 | noexcept(...) | TAINT |
1938-
| stl.h:235:30:235:40 | call to allocator | stl.h:235:21:235:41 | noexcept(...) | TAINT |
1939-
| stl.h:235:53:235:63 | 0 | stl.h:235:46:235:64 | (no string representation) | TAINT |
1940-
| stl.h:328:9:328:9 | Unknown literal | stl.h:328:9:328:9 | constructor init of field first | TAINT |
1941-
| stl.h:328:9:328:9 | Unknown literal | stl.h:328:9:328:9 | constructor init of field second | TAINT |
1942-
| stl.h:328:9:328:9 | constructor init of field first [post-this] | stl.h:328:9:328:9 | constructor init of field second [pre-this] | |
1943-
| stl.h:328:9:328:9 | constructor init of field first [pre-this] | stl.h:328:9:328:9 | constructor init of field second [pre-this] | |
1944-
| stl.h:328:9:328:9 | this | stl.h:328:9:328:9 | constructor init of field first [pre-this] | |
1945-
| stl.h:335:3:335:3 | this | stl.h:335:36:335:43 | constructor init of field first [pre-this] | |
1946-
| stl.h:335:3:335:6 | this | stl.h:335:36:335:43 | constructor init of field first [pre-this] | |
1947-
| stl.h:335:18:335:18 | x | stl.h:335:42:335:42 | x | |
1948-
| stl.h:335:18:335:18 | x | stl.h:335:42:335:42 | x | |
1949-
| stl.h:335:31:335:31 | y | stl.h:335:53:335:53 | y | |
1950-
| stl.h:335:31:335:31 | y | stl.h:335:53:335:53 | y | |
1951-
| stl.h:335:36:335:43 | call to unknown function | stl.h:335:36:335:43 | constructor init of field first | TAINT |
1952-
| stl.h:335:36:335:43 | constructor init of field first [post-this] | stl.h:335:46:335:54 | constructor init of field second [pre-this] | |
1953-
| stl.h:335:36:335:43 | constructor init of field first [post-this] | stl.h:335:46:335:54 | constructor init of field second [pre-this] | |
1954-
| stl.h:335:36:335:43 | constructor init of field first [pre-this] | stl.h:335:46:335:54 | constructor init of field second [pre-this] | |
1955-
| stl.h:335:36:335:43 | constructor init of field first [pre-this] | stl.h:335:46:335:54 | constructor init of field second [pre-this] | |
1956-
| stl.h:335:42:335:42 | x | stl.h:335:36:335:43 | constructor init of field first | TAINT |
1957-
| stl.h:335:46:335:54 | call to unknown function | stl.h:335:46:335:54 | constructor init of field second | TAINT |
1958-
| stl.h:335:53:335:53 | y | stl.h:335:46:335:54 | constructor init of field second | TAINT |
1934+
| stl.h:241:30:241:40 | call to allocator | stl.h:241:21:241:41 | noexcept(...) | TAINT |
1935+
| stl.h:241:30:241:40 | call to allocator | stl.h:241:21:241:41 | noexcept(...) | TAINT |
1936+
| stl.h:241:30:241:40 | call to allocator | stl.h:241:21:241:41 | noexcept(...) | TAINT |
1937+
| stl.h:241:30:241:40 | call to allocator | stl.h:241:21:241:41 | noexcept(...) | TAINT |
1938+
| stl.h:241:30:241:40 | call to allocator | stl.h:241:21:241:41 | noexcept(...) | TAINT |
1939+
| stl.h:241:53:241:63 | 0 | stl.h:241:46:241:64 | (no string representation) | TAINT |
1940+
| stl.h:334:9:334:9 | Unknown literal | stl.h:334:9:334:9 | constructor init of field first | TAINT |
1941+
| stl.h:334:9:334:9 | Unknown literal | stl.h:334:9:334:9 | constructor init of field second | TAINT |
1942+
| stl.h:334:9:334:9 | constructor init of field first [post-this] | stl.h:334:9:334:9 | constructor init of field second [pre-this] | |
1943+
| stl.h:334:9:334:9 | constructor init of field first [pre-this] | stl.h:334:9:334:9 | constructor init of field second [pre-this] | |
1944+
| stl.h:334:9:334:9 | this | stl.h:334:9:334:9 | constructor init of field first [pre-this] | |
1945+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1946+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1947+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1948+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1949+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1950+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1951+
| stl.h:341:3:341:3 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1952+
| stl.h:341:3:341:6 | this | stl.h:341:36:341:43 | constructor init of field first [pre-this] | |
1953+
| stl.h:341:18:341:18 | x | stl.h:341:18:341:18 | x | |
1954+
| stl.h:341:18:341:18 | x | stl.h:341:18:341:18 | x | |
1955+
| stl.h:341:18:341:18 | x | stl.h:341:18:341:18 | x | |
1956+
| stl.h:341:18:341:18 | x | stl.h:341:18:341:18 | x | |
1957+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1958+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1959+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1960+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1961+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1962+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1963+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1964+
| stl.h:341:18:341:18 | x | stl.h:341:42:341:42 | x | |
1965+
| stl.h:341:31:341:31 | y | stl.h:341:31:341:31 | y | |
1966+
| stl.h:341:31:341:31 | y | stl.h:341:31:341:31 | y | |
1967+
| stl.h:341:31:341:31 | y | stl.h:341:31:341:31 | y | |
1968+
| stl.h:341:31:341:31 | y | stl.h:341:31:341:31 | y | |
1969+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1970+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1971+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1972+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1973+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1974+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1975+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1976+
| stl.h:341:31:341:31 | y | stl.h:341:53:341:53 | y | |
1977+
| stl.h:341:36:341:43 | call to unknown function | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1978+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1979+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1980+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1981+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1982+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1983+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1984+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1985+
| stl.h:341:36:341:43 | constructor init of field first [post-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1986+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1987+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1988+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1989+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1990+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1991+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1992+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1993+
| stl.h:341:36:341:43 | constructor init of field first [pre-this] | stl.h:341:46:341:54 | constructor init of field second [pre-this] | |
1994+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1995+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1996+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1997+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1998+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
1999+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
2000+
| stl.h:341:42:341:42 | x | stl.h:341:36:341:43 | constructor init of field first | TAINT |
2001+
| stl.h:341:46:341:54 | call to unknown function | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2002+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2003+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2004+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2005+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2006+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2007+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2008+
| stl.h:341:53:341:53 | y | stl.h:341:46:341:54 | constructor init of field second | TAINT |
2009+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2010+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2011+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2012+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2013+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2014+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2015+
| stl.h:347:109:347:109 | x | stl.h:347:109:347:109 | x | |
2016+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2017+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2018+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2019+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2020+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2021+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2022+
| stl.h:347:109:347:109 | x | stl.h:348:40:348:40 | x | |
2023+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2024+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2025+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2026+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2027+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2028+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2029+
| stl.h:347:117:347:117 | y | stl.h:347:117:347:117 | y | |
2030+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2031+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2032+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2033+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2034+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2035+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2036+
| stl.h:347:117:347:117 | y | stl.h:348:61:348:61 | y | |
2037+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2038+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2039+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2040+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2041+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2042+
| stl.h:348:10:348:63 | call to pair | stl.h:348:10:348:63 | call to pair | TAINT |
2043+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:347:109:347:109 | x | |
2044+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:347:109:347:109 | x | |
2045+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:347:109:347:109 | x | |
2046+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:347:109:347:109 | x | |
2047+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:348:40:348:40 | x [inner post update] | |
2048+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:348:40:348:40 | x [inner post update] | |
2049+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:348:40:348:40 | x [inner post update] | |
2050+
| stl.h:348:23:348:38 | ref arg call to forward | stl.h:348:40:348:40 | x [inner post update] | |
2051+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2052+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2053+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2054+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2055+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2056+
| stl.h:348:40:348:40 | x | stl.h:348:23:348:38 | call to forward | |
2057+
| stl.h:348:44:348:59 | call to forward | stl.h:348:10:348:63 | call to pair | TAINT |
2058+
| stl.h:348:44:348:59 | call to forward | stl.h:348:10:348:63 | call to pair | TAINT |
2059+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:347:117:347:117 | y | |
2060+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:347:117:347:117 | y | |
2061+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:347:117:347:117 | y | |
2062+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:347:117:347:117 | y | |
2063+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:348:61:348:61 | y [inner post update] | |
2064+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:348:61:348:61 | y [inner post update] | |
2065+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:348:61:348:61 | y [inner post update] | |
2066+
| stl.h:348:44:348:59 | ref arg call to forward | stl.h:348:61:348:61 | y [inner post update] | |
2067+
| stl.h:348:61:348:61 | y | stl.h:348:10:348:63 | call to pair | TAINT |
2068+
| stl.h:348:61:348:61 | y | stl.h:348:10:348:63 | call to pair | TAINT |
2069+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
2070+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
2071+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
2072+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
2073+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
2074+
| stl.h:348:61:348:61 | y | stl.h:348:44:348:59 | call to forward | |
19592075
| string.cpp:24:12:24:17 | call to source | string.cpp:28:7:28:7 | a | |
19602076
| string.cpp:25:16:25:20 | 123 | string.cpp:25:16:25:21 | call to basic_string | TAINT |
19612077
| string.cpp:25:16:25:21 | call to basic_string | string.cpp:29:7:29:7 | b | |

cpp/ql/test/library-tests/dataflow/taint-tests/stl.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ struct remove_reference<T &&> { typedef T type; };
2424
template<class T>
2525
using remove_reference_t = typename remove_reference<T>::type;
2626

27+
namespace std
28+
{
29+
template<class T> constexpr T&& forward(remove_reference_t<T>& t) noexcept;
30+
template<class T> constexpr T&& forward(remove_reference_t<T>&& t) noexcept;
31+
}
32+
2733
// --- iterator ---
2834

2935
namespace std {
@@ -338,7 +344,9 @@ namespace std {
338344
void swap(pair& p) /*noexcept(...)*/;
339345
};
340346

341-
template<class T1, class T2> constexpr pair<remove_reference_t<T1>, remove_reference_t<T2>> make_pair(T1&& x, T2&& y);
347+
template<class T1, class T2> constexpr pair<remove_reference_t<T1>, remove_reference_t<T2>> make_pair(T1&& x, T2&& y) {
348+
return pair<T1, T2>(std::forward<T1>(x), std::forward<T2>(y));
349+
}
342350
}
343351

344352
// --- map ---

0 commit comments

Comments
 (0)