Fix up clang-tidy after clang r314037.

llvm-svn: 314047
This commit is contained in:
Richard Smith 2017-09-22 23:47:20 +00:00
parent f193332994
commit 2ccecb9d88
2 changed files with 14 additions and 11 deletions

View File

@ -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)) {

View File

@ -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;