qualified-id.cpp 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. // PR5061
  3. namespace a {
  4. template <typename T> class C {};
  5. }
  6. namespace b {
  7. template<typename T> void f0(a::C<T> &a0) { }
  8. }
  9. namespace test1 {
  10. int a = 0;
  11. template <class T> class Base { };
  12. template <class T> class Derived : public Base<T> {
  13. int foo() {
  14. return test1::a;
  15. }
  16. };
  17. }
  18. namespace test2 {
  19. class Impl {
  20. public:
  21. int foo();
  22. };
  23. template <class T> class Magic : public Impl {
  24. int foo() {
  25. return Impl::foo();
  26. }
  27. };
  28. }
  29. namespace PR6063 {
  30. template <typename T> void f(T, T);
  31. namespace detail
  32. {
  33. using PR6063::f;
  34. }
  35. template <typename T>
  36. void g(T a, T b)
  37. {
  38. detail::f(a, b);
  39. }
  40. }
  41. namespace PR12291 {
  42. template <typename T>
  43. class Outer2 {
  44. template <typename V>
  45. template <typename W>
  46. class Outer2<V>::Inner; // expected-error{{nested name specifier 'Outer2<V>::' for declaration does not refer into a class, class template or class template partial specialization}}
  47. };
  48. }