2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-05-13 05:43:46 +08:00
|
|
|
|
|
|
|
|
2010-08-29 04:17:00 +08:00
|
|
|
namespace test0 {
|
|
|
|
// p3
|
|
|
|
template<typename T> int foo(T), bar(T, T); // expected-error{{single entity}}
|
|
|
|
}
|
|
|
|
|
|
|
|
// PR7252
|
|
|
|
namespace test1 {
|
2019-02-16 05:53:07 +08:00
|
|
|
namespace A { template<typename T> struct Base { typedef T t; }; } // expected-note 3{{member}}
|
2010-08-29 04:17:00 +08:00
|
|
|
namespace B { template<typename T> struct Base { typedef T t; }; } // expected-note {{member found}}
|
|
|
|
|
|
|
|
template<typename T> struct Derived : A::Base<char>, B::Base<int> {
|
2019-02-16 05:53:07 +08:00
|
|
|
typename Derived::Base<float>::t x; // expected-error {{found in multiple base classes of different types}}
|
2010-08-29 04:17:00 +08:00
|
|
|
};
|
2019-02-16 05:53:07 +08:00
|
|
|
|
|
|
|
class X : A::Base<int> {}; // expected-note 2{{private}}
|
|
|
|
class Y : A::Base<float> {};
|
|
|
|
struct Z : A::Base<double> {};
|
|
|
|
struct Use1 : X, Y {
|
|
|
|
Base<double> b1; // expected-error {{private}}
|
|
|
|
Use1::Base<double> b2; // expected-error {{private}}
|
|
|
|
};
|
|
|
|
struct Use2 : Z, Y {
|
|
|
|
Base<double> b1;
|
|
|
|
Use2::Base<double> b2;
|
|
|
|
};
|
|
|
|
struct Use3 : X, Z {
|
|
|
|
Base<double> b1;
|
|
|
|
Use3::Base<double> b2;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace test2 {
|
|
|
|
struct A { static int x; }; // expected-note 4{{member}}
|
|
|
|
struct B { template<typename T> static T x(); }; // expected-note 4{{member}}
|
|
|
|
struct C { template<typename T> struct x {}; }; // expected-note 3{{member}}
|
|
|
|
struct D { template<typename T> static T x(); }; // expected-note {{member}}
|
|
|
|
|
|
|
|
template<typename ...T> struct X : T... {};
|
|
|
|
|
|
|
|
void f() {
|
|
|
|
X<A, B>::x<int>(); // expected-error {{found in multiple base classes of different types}}
|
|
|
|
X<A, C>::x<int>(); // expected-error {{found in multiple base classes of different types}}
|
|
|
|
X<B, C>::x<int>(); // expected-error {{found in multiple base classes of different types}}
|
|
|
|
X<A, B, C>::x<int>(); // expected-error {{found in multiple base classes of different types}}
|
|
|
|
X<A, B, D>::x<int>(); // expected-error {{found in multiple base classes of different types}}
|
|
|
|
}
|
2010-08-29 04:17:00 +08:00
|
|
|
}
|