26 lines · cpp
1int foo(int, int);2int foo(int, double);3int x;4 5void testTypedRecoveryExpr1() {6 // Inner bar() is an unresolved overloaded call, outer foo() is an overloaded call.7 foo(x, bar(x));8}9// RUN: c-index-test -cursor-at=%s:7:3 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=OUTER-FOO %s10// OUTER-FOO: OverloadedDeclRef=foo[2:5, 1:5]11// RUN: c-index-test -cursor-at=%s:7:7 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=OUTER-X %s12// OUTER-X: DeclRefExpr=x:3:513// RUN: c-index-test -cursor-at=%s:7:10 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=INNER-FOO %s14// INNER-FOO: OverloadedDeclRef=bar15// RUN: c-index-test -cursor-at=%s:7:14 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=INNER-X %s16// INNER-X: DeclRefExpr=x:3:517 18void testTypedRecoveryExpr2() {19 // Inner foo() is a RecoveryExpr (with int type), outer foo() is a valid "foo(int, int)" call.20 foo(x, foo(x));21}22// RUN: c-index-test -cursor-at=%s:20:3 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=TEST2-OUTER %s23// TEST2-OUTER: DeclRefExpr=foo:1:524// RUN: c-index-test -cursor-at=%s:20:10 %s -Xclang -frecovery-ast -Xclang -frecovery-ast-type | FileCheck -check-prefix=TEST2-INNER %s25// TEST2-INNER: OverloadedDeclRef=foo[2:5, 1:5]26