forked from OSchip/llvm-project
parent
f193332994
commit
2ccecb9d88
|
@ -94,7 +94,10 @@ void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
|
|||
//
|
||||
// Although these might also cause ODR violations, we can be less certain and
|
||||
// should try to keep the false-positive rate down.
|
||||
if (ND->getLinkageInternal() == InternalLinkage)
|
||||
//
|
||||
// FIXME: Should declarations in anonymous namespaces get the same treatment
|
||||
// as static / const declarations?
|
||||
if (!ND->hasExternalFormalLinkage() && !ND->isInAnonymousNamespace())
|
||||
return;
|
||||
|
||||
if (const auto *FD = dyn_cast<FunctionDecl>(ND)) {
|
||||
|
|
|
@ -6,20 +6,20 @@ class default_delete {};
|
|||
template <typename type, typename Deleter = std::default_delete<type>>
|
||||
class unique_ptr {
|
||||
public:
|
||||
unique_ptr();
|
||||
unique_ptr(type *ptr);
|
||||
unique_ptr() {}
|
||||
unique_ptr(type *ptr) {}
|
||||
unique_ptr(const unique_ptr<type> &t) = delete;
|
||||
unique_ptr(unique_ptr<type> &&t);
|
||||
~unique_ptr();
|
||||
unique_ptr(unique_ptr<type> &&t) {}
|
||||
~unique_ptr() {}
|
||||
type &operator*() { return *ptr; }
|
||||
type *operator->() { return ptr; }
|
||||
type *release();
|
||||
void reset();
|
||||
void reset(type *pt);
|
||||
void reset(type pt);
|
||||
unique_ptr &operator=(unique_ptr &&);
|
||||
type *release() { return ptr; }
|
||||
void reset() {}
|
||||
void reset(type *pt) {}
|
||||
void reset(type pt) {}
|
||||
unique_ptr &operator=(unique_ptr &&) { return *this; }
|
||||
template <typename T>
|
||||
unique_ptr &operator=(unique_ptr<T> &&);
|
||||
unique_ptr &operator=(unique_ptr<T> &&) { return *this; }
|
||||
|
||||
private:
|
||||
type *ptr;
|
||||
|
|
Loading…
Reference in New Issue