namespaces.cpp 746 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Test this without pch.
  2. // RUN: %clang_cc1 -x c++ -include %S/Inputs/namespaces.h -fsyntax-only %s
  3. // Test with pch.
  4. // RUN: %clang_cc1 -x c++ -emit-pch -o %t %S/Inputs/namespaces.h
  5. // RUN: %clang_cc1 -x c++ -include-pch %t -fsyntax-only %s
  6. int int_val;
  7. N1::t1 *ip1 = &int_val;
  8. N1::t2 *ip2 = &int_val;
  9. N2::Inner::t3 *ip3 = &int_val;
  10. float float_val;
  11. namespace N2 { }
  12. N2::t1 *fp1 = &float_val;
  13. Alias1::t3 *ip4 = &int_val;
  14. t3 *ip5 = &int_val;
  15. void(*funp1)() = anon;
  16. namespace {
  17. class C;
  18. }
  19. C* cp1;
  20. namespace N3 {
  21. namespace {
  22. class C;
  23. }
  24. }
  25. N3::C *cp2;
  26. void(*funp2)() = ext;
  27. using N1::used_func;
  28. void (*pused)() = used_func;
  29. using N1::used_cls;
  30. used_cls s1;
  31. used_cls* ps1 = &s1;
  32. inline namespace N4 { }
  33. struct MemberOfN4 *mn4;