class-template-id-2.cpp 468 B

123456789101112131415161718192021222324
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. namespace N {
  3. template<typename T> class A { };
  4. template<> class A<int> { };
  5. template<> class A<float>; // expected-note{{forward declaration of 'N::A<float>'}}
  6. class B : public A<int> { };
  7. }
  8. class C1 : public N::A<int> { };
  9. class C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}}
  10. struct D1 {
  11. operator N::A<int>();
  12. };
  13. namespace N {
  14. struct D2 {
  15. operator A<int>();
  16. };
  17. }