p3.cpp 406 B

12345678910111213141516171819202122232425
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // expected-no-diagnostics
  3. typedef int f;
  4. namespace N0 {
  5. struct A {
  6. friend void f();
  7. void g() {
  8. int i = f(1);
  9. }
  10. };
  11. }
  12. namespace N1 {
  13. struct A {
  14. friend void f(A &);
  15. operator int();
  16. void g(A a) {
  17. // ADL should not apply to the lookup of 'f', it refers to the typedef
  18. // above.
  19. int i = f(a);
  20. }
  21. };
  22. }