complete-template-friends-defined.cpp 919 B

123456789101112131415161718192021222324252627282930313233
  1. // The run lines are below, because this test is line- and
  2. // column-number sensitive.
  3. namespace N {
  4. template<typename T> struct A {
  5. template<typename U> friend class B;
  6. };
  7. template<typename T> struct B { };
  8. }
  9. void foo() {
  10. N::A<int> a1;
  11. N::A<int> a2;
  12. }
  13. namespace M {
  14. template<typename T> struct C {
  15. template<typename U> friend struct C;
  16. };
  17. }
  18. void bar() {
  19. M::C<int> c1;
  20. M::C<int> c2;
  21. }
  22. // RUN: c-index-test -code-completion-at=%s:14:6 %s | FileCheck -check-prefix=CHECK-ACCESS-1 %s
  23. // CHECK-ACCESS-1: ClassTemplate:{TypedText A}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
  24. // CHECK-ACCESS-1: ClassTemplate:{TypedText B}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)
  25. // RUN: c-index-test -code-completion-at=%s:25:6 %s | FileCheck -check-prefix=CHECK-ACCESS-2 %s
  26. // CHECK-ACCESS-2: ClassTemplate:{TypedText C}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50)