@@ -95,7 +95,7 @@ TEST(HighlightsTest, All) {
9595 )cpp" ,
9696
9797 R"cpp( // Function
98- int [[^foo]](int) {}
98+ int [[^foo]](int) { return 0; }
9999 int main() {
100100 [[foo]]([[foo]](42));
101101 auto *X = &[[foo]];
@@ -2140,7 +2140,7 @@ TEST(FindReferences, WithinAST) {
21402140 )cpp" ,
21412141
21422142 R"cpp( // Function
2143- int $def[[foo]](int) {}
2143+ int $def[[foo]](int) { return 0; }
21442144 int main() {
21452145 auto *X = &$(main)[[^foo]];
21462146 $(main)[[foo]](42);
@@ -2160,7 +2160,7 @@ TEST(FindReferences, WithinAST) {
21602160
21612161 R"cpp( // Method call
21622162 struct Foo { int $decl(Foo)[[foo]](); };
2163- int Foo::$def(Foo)[[foo]]() {}
2163+ int Foo::$def(Foo)[[foo]]() { return 0; }
21642164 int main() {
21652165 Foo f;
21662166 f.$(main)[[^foo]]();
@@ -2258,7 +2258,7 @@ TEST(FindReferences, WithinAST) {
22582258 )cpp" ,
22592259 R"cpp( // Dependent code
22602260 template <typename T> void $decl[[foo]](T t);
2261- template <typename T> void bar(T t) { $(bar)[[foo]](t); } // foo in bar is uninstantiated.
2261+ template <typename T> void bar(T t) { $(bar)[[foo]](t); } // foo in bar is uninstantiated.
22622262 void baz(int x) { $(baz)[[f^oo]](x); }
22632263 )cpp" ,
22642264 R"cpp(
@@ -2508,6 +2508,7 @@ TEST(FindReferences, ExplicitSymbols) {
25082508 X $def(test)[[a]];
25092509 $(test)[[a]].operator bool();
25102510 if ($(test)[[a^]]) {} // ignore implicit conversion-operator AST node
2511+ return 0;
25112512 }
25122513 )cpp" ,
25132514 };
@@ -2543,7 +2544,7 @@ TEST(FindReferences, UsedSymbolsFromInclude) {
25432544 #define BAR 5
25442545 int bar1();
25452546 int bar2();
2546- class Bar {};
2547+ class Bar {};
25472548 )cpp" );
25482549 TU.AdditionalFiles [" system/vector" ] = guard (R"cpp(
25492550 namespace std {
@@ -2560,7 +2561,7 @@ TEST(FindReferences, UsedSymbolsFromInclude) {
25602561 std::vector<Matcher<ReferencesResult::Reference>> ExpectedLocations;
25612562 for (const auto &R : T.ranges ())
25622563 ExpectedLocations.push_back (AllOf (rangeIs (R), attrsAre (0u )));
2563- for (const auto &P : T.points ())
2564+ for (const auto &P : T.points ())
25642565 EXPECT_THAT (findReferences (AST, P, 0 ).References ,
25652566 UnorderedElementsAreArray (ExpectedLocations))
25662567 << " Failed for Refs at " << P << " \n "
@@ -2635,6 +2636,7 @@ TEST(FindReferences, NeedsIndexForMacro) {
26352636 Annotations IndexedMain (R"cpp(
26362637 int indexed_main() {
26372638 int a = [[MACRO]](1);
2639+ return 0;
26382640 }
26392641 )cpp" );
26402642
0 commit comments