When a template class takes Ref<T> as a template parameter and this template parameter is used as the return value of a member function, the return value can be treated as unsafe (i.e. emits a false positive). The issue was caused by getCanonicalType sometimes converting Ref<T> to T. Workaround this problem by avoid emitting a warning when the original, non-canonical type is a safe pointer type.
22 lines
372 B
C++
22 lines
372 B
C++
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
#include "mock-types.h"
|
|
|
|
struct Obj {
|
|
void ref() const;
|
|
void deref() const;
|
|
|
|
void someFunction();
|
|
};
|
|
|
|
template<typename T> class Wrapper {
|
|
public:
|
|
T obj();
|
|
};
|
|
|
|
static void foo(Wrapper<Ref<Obj>>&& wrapper)
|
|
{
|
|
wrapper.obj()->someFunction();
|
|
}
|