Adapt clang-tidy checks to changing semantics of hasDeclaration.

Differential Revision: https://reviews.llvm.org/D36154

llvm-svn: 309810
diff --git a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
index 24680eb..5604354 100644
--- a/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
@@ -32,16 +32,18 @@
   if (!getLangOpts().CPlusPlus)
     return;
 
-  const auto ValidContainer = cxxRecordDecl(isSameOrDerivedFrom(
-      namedDecl(
-          has(cxxMethodDecl(
-                  isConst(), parameterCountIs(0), isPublic(), hasName("size"),
-                  returns(qualType(isInteger(), unless(booleanType()))))
-                  .bind("size")),
-          has(cxxMethodDecl(isConst(), parameterCountIs(0), isPublic(),
-                            hasName("empty"), returns(booleanType()))
-                  .bind("empty")))
-          .bind("container")));
+  const auto ValidContainer = qualType(hasUnqualifiedDesugaredType(
+      recordType(hasDeclaration(cxxRecordDecl(isSameOrDerivedFrom(
+          namedDecl(
+              has(cxxMethodDecl(
+                      isConst(), parameterCountIs(0), isPublic(),
+                      hasName("size"),
+                      returns(qualType(isInteger(), unless(booleanType()))))
+                      .bind("size")),
+              has(cxxMethodDecl(isConst(), parameterCountIs(0), isPublic(),
+                                hasName("empty"), returns(booleanType()))
+                      .bind("empty")))
+              .bind("container")))))));
 
   const auto WrongUse = anyOf(
       hasParent(binaryOperator(