[AST] No longer visiting CXXMethodDecl bodies created by compiler when method was default created.

Summary:
Clang generates function bodies and puts them in the AST for default methods if it is defaulted outside the class definition.

`
struct A {
   A &operator=(A &&O);
};

A &A::operator=(A &&O) = default;
`

This will generate a function body for the `A &A::operator=(A &&O)` and put it in the AST. This body should not be visited if implicit code is not visited as it is implicit.

This was causing SemanticHighlighting in clangd to generate duplicate tokens and putting them in weird places.

Reviewers: hokein, ilya-biryukov, gribozavr

Subscribers: mgorny, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@368402 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/clangd/unittests/SemanticHighlightingTests.cpp b/clangd/unittests/SemanticHighlightingTests.cpp
index 3ff7bbc..4405134 100644
--- a/clangd/unittests/SemanticHighlightingTests.cpp
+++ b/clangd/unittests/SemanticHighlightingTests.cpp
@@ -55,7 +55,7 @@
   Annotations Test(Code);
   auto AST = TestTU::withCode(Test.code()).build();
   std::vector<HighlightingToken> ActualTokens = getSemanticHighlightings(AST);
-  EXPECT_THAT(ActualTokens, getExpectedTokens(Test));
+  EXPECT_THAT(ActualTokens, getExpectedTokens(Test)) << Code;
 }
 
 // Any annotations in OldCode and NewCode are converted into their corresponding
@@ -276,6 +276,15 @@
         $Class[[Foo]] *$Variable[[FP]] = ($Class[[Foo]]*)$Variable[[B]];
         $Primitive[[int]] $Variable[[I]] = ($Primitive[[int]])$Variable[[B]];
       }
+    )cpp"
+    R"cpp(
+      struct $Class[[B]] {};
+      struct $Class[[A]] {
+        $Class[[B]] $Field[[BB]];
+        $Class[[A]] &operator=($Class[[A]] &&$Variable[[O]]);
+      };
+
+      $Class[[A]] &$Class[[A]]::operator=($Class[[A]] &&$Variable[[O]]) = default;
     )cpp"};
   for (const auto &TestCase : TestCases) {
     checkHighlightings(TestCase);