1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 template<class X
> struct A
{};
7 template<class X
> struct B
: A
<X
> {
12 template<class X
> struct B1
: A
<X
> {
19 template<typename T
> struct Tmpl
{ };
21 template<typename T
> struct TmplB
{ };
23 struct TmplC
: Tmpl
<int> {
26 TmplB
<int>() { } // expected-error {{type 'TmplB<int>' is not a direct or virtual base of 'TmplC'}}
30 struct TmplD
: Tmpl
<char>, TmplB
<char> {
32 Tmpl
<int>(), // expected-error {{type 'Tmpl<int>' is not a direct or virtual base of 'TmplD'}}
42 template <class ParentClass
>
43 class Derived
: public ParentClass
{
48 class Final
: public Derived
<Base
> {
59 namespace NonDependentError
{
60 struct Base
{ Base(int); }; // expected-note {{candidate constructor not viable}}
61 // expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable}}
62 #if __cplusplus >= 201103L // C++11 or later
63 // expected-note@-3 {{candidate constructor (the implicit move constructor) not viable}}
67 struct Derived1
: Base
{
68 Derived1() : Base(1, 2) {} // expected-error {{no matching constructor}}
72 struct Derived2
: Base
{
73 Derived2() : BaseClass(1) {} // expected-error {{does not name a non-static data member or base}}