C++: Add test from issue #5190.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-03-31 11:32:01 +02:00
parent 49d1937dc4
commit 8159098dc0
2 changed files with 11 additions and 1 deletions

View File

@@ -65,4 +65,14 @@ void test_shared_field_member() {
std::unique_ptr<A> p = std::make_unique<A>(source(), 0);
sink(p->x); // $ MISSING: ast,ir
sink(p->y); // not tainted
}
void getNumber(std::shared_ptr<int> ptr) {
*ptr = source();
}
int test_from_issue_5190() {
std::shared_ptr<int> p(new int);
getNumber(p);
sink(*p); // $ MISSING: ast,ir
}

View File

@@ -348,7 +348,7 @@ namespace std {
class shared_ptr {
public:
shared_ptr() noexcept;
explicit shared_ptr(T*);
explicit shared_ptr(T*); shared_ptr(const shared_ptr&) noexcept;
template<class U> shared_ptr(const shared_ptr<U>&) noexcept;
template<class U> shared_ptr(shared_ptr<U>&&) noexcept;