summaryrefslogtreecommitdiffstats
path: root/test/Index/complete-super.cpp
blob: a10cafc2c7e94a9398e6afe8ae46a7b323000d9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// The run lines are below, because this test is line- and
// column-number sensitive.

struct A {
  virtual void foo(int x, int y);
  virtual void bar(double x);
  virtual void bar(float x);
};

struct B : A {
  void foo(int a, int b);
  void bar(float real);
};

void B::foo(int a, int b) {
  A::foo(a, b);
}

void B::bar(float real) {
  A::bar(real);
}

// RUN: c-index-test -code-completion-at=%s:16:3 %s | FileCheck -check-prefix=CHECK-FOO-UNQUAL %s
// CHECK-FOO-UNQUAL: CXXMethod:{Text A::}{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (8)

// RUN: c-index-test -code-completion-at=%s:20:3 %s | FileCheck -check-prefix=CHECK-BAR-UNQUAL %s
// CHECK-BAR-UNQUAL: CXXMethod:{Text A::}{TypedText bar}{LeftParen (}{Placeholder real}{RightParen )} (8)
// CHECK-BAR-UNQUAL: FunctionDecl:{ResultType void}{TypedText bar}{LeftParen (}{Placeholder float real}{RightParen )} (14)
// CHECK-BAR-UNQUAL: FunctionDecl:{ResultType void}{Text A::}{TypedText bar}{LeftParen (}{Placeholder double x}{RightParen )} (16)

// RUN: c-index-test -code-completion-at=%s:16:6 %s | FileCheck -check-prefix=CHECK-FOO-QUAL %s
// CHECK-FOO-QUAL: CXXMethod:{TypedText foo}{LeftParen (}{Placeholder a}{Comma , }{Placeholder b}{RightParen )} (8)