1ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao// RUN: %clang_cc1 -fsyntax-only -verify %s
2ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaonamespace N {
3ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  template<typename T> class A { };
4ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
5ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  template<> class A<int> { };
6ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
7ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  template<> class A<float>; // expected-note{{forward declaration of 'N::A<float>'}}
8ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
9ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  class B : public A<int> { };
10ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
11ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
12ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoclass C1 : public N::A<int> { };
13ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
14ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoclass C2 : public N::A<float> { }; // expected-error{{base class has incomplete type}}
15ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
16ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaostruct D1 {
17ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  operator N::A<int>();
18ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao};
19ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
20ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaonamespace N {
21ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  struct D2 {
22ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao    operator A<int>();
23ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  };
24ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
25