2
0

complete-memfunc-cvquals.cpp 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // The run lines are below, because this test is line- and
  2. // column-number sensitive.
  3. struct Foo {
  4. void babble() const volatile;
  5. void bar();
  6. void baz() const;
  7. void bingo() volatile;
  8. void theend() const volatile;
  9. };
  10. template<typename T>
  11. struct smart_ptr {
  12. T *operator->();
  13. const T* operator->() const;
  14. };
  15. void text(Foo f, Foo *fp, const Foo &fc, const Foo *fcp,
  16. smart_ptr<Foo> sf, const smart_ptr<Foo> &sfc, Foo volatile *fvp) {
  17. f.bar();
  18. fp->bar();
  19. fc.baz();
  20. fcp->baz();
  21. sf->bar();
  22. sfc->baz();
  23. fvp->babble();
  24. }
  25. void Foo::bar() {
  26. }
  27. void Foo::baz() const {
  28. }
  29. void Foo::bingo() volatile {
  30. }
  31. // Check member access expressions.
  32. // RUN: c-index-test -code-completion-at=%s:19:5 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
  33. // RUN: c-index-test -code-completion-at=%s:20:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
  34. // RUN: c-index-test -code-completion-at=%s:23:7 %s | FileCheck -check-prefix=CHECK-NOQUALS %s
  35. // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  36. // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34)
  37. // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35)
  38. // CHECK-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35)
  39. // RUN: c-index-test -code-completion-at=%s:21:6 %s | FileCheck -check-prefix=CHECK-CONST %s
  40. // RUN: c-index-test -code-completion-at=%s:22:8 %s | FileCheck -check-prefix=CHECK-CONST %s
  41. // RUN: c-index-test -code-completion-at=%s:24:8 %s | FileCheck -check-prefix=CHECK-CONST %s
  42. // CHECK-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  43. // CHECK-CONST-NOT: bar
  44. // CHECK-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34)
  45. // CHECK-CONST-NOT: bingo
  46. // CHECK-CONST: theend
  47. // RUN: c-index-test -code-completion-at=%s:25:8 %s | FileCheck -check-prefix=CHECK-VOLATILE %s
  48. // CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  49. // CHECK-VOLATILE-NOT: baz
  50. // CHECK-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34)
  51. // Check implicit member access expressions.
  52. // RUN: c-index-test -code-completion-at=%s:29:2 %s | FileCheck -check-prefix=CHECK-IMPLICIT-NOQUALS %s
  53. // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  54. // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bar}{LeftParen (}{RightParen )} (34)
  55. // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (35)
  56. // CHECK-IMPLICIT-NOQUALS: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (35)
  57. // RUN: c-index-test -code-completion-at=%s:33:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-CONST %s
  58. // CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  59. // CHECK-IMPLICIT-CONST-NOT: bar
  60. // CHECK-IMPLICIT-CONST: CXXMethod:{ResultType void}{TypedText baz}{LeftParen (}{RightParen )}{Informative const} (34)
  61. // CHECK-IMPLICIT-CONST-NOT: bingo
  62. // CHECK-IMPLICIT-CONST: theend
  63. // RUN: c-index-test -code-completion-at=%s:37:1 %s | FileCheck -check-prefix=CHECK-IMPLICIT-VOLATILE %s
  64. // CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText babble}{LeftParen (}{RightParen )}{Informative const volatile} (35)
  65. // CHECK-IMPLICIT-VOLATILE-NOT: baz
  66. // CHECK-IMPLICIT-VOLATILE: CXXMethod:{ResultType void}{TypedText bingo}{LeftParen (}{RightParen )}{Informative volatile} (34)
  67. // RUN: c-index-test -code-completion-at=%s:4:17 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER %s
  68. // CHECK-CVQUAL-AFTER: NotImplemented:{TypedText const} (40)
  69. // CHECK-CVQUAL-AFTER: NotImplemented:{TypedText volatile} (40)
  70. // RUN: c-index-test -code-completion-at=%s:4:23 %s | FileCheck -check-prefix=CHECK-CVQUAL-AFTER2 %s
  71. // CHECK-CVQUAL-AFTER2-NOT: NotImplemented:{TypedText const} (40)
  72. // CHECK-CVQUAL-AFTER2: NotImplemented:{TypedText volatile} (40)