Douglas Gregor | 41f9030 | 2010-04-12 20:54:26 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -verify %s |
| 2 | |
| 3 | template <class T> struct Base { // expected-note 4 {{member found by ambiguous name lookup}} |
| 4 | static void f(); |
| 5 | }; |
| 6 | |
| 7 | struct X0 { }; |
| 8 | |
| 9 | template <class T> struct Derived: Base<int>, Base<char> { |
| 10 | typename Derived::Base b; // expected-error{{member 'Base' found in multiple base classes of different types}} |
| 11 | typename Derived::Base<double> d; // OK |
| 12 | |
| 13 | void g(X0 *t) { |
| 14 | t->Derived::Base<T>::f(); |
| 15 | t->Base<T>::f(); |
| 16 | t->Base::f(); // expected-error{{member 'Base' found in multiple base classes of different types}} \ |
Richard Smith | 4b213d7 | 2015-11-12 22:40:09 +0000 | [diff] [blame] | 17 | // expected-error{{no member named 'f' in 'X0'}} |
Douglas Gregor | 41f9030 | 2010-04-12 20:54:26 +0000 | [diff] [blame] | 18 | } |
| 19 | }; |
| 20 | |
| 21 | namespace PR6717 { |
| 22 | template <typename T> |
| 23 | class WebVector { |
Richard Smith | 7b8c3c9 | 2011-07-14 21:35:26 +0000 | [diff] [blame] | 24 | } // expected-error {{expected ';' after class}} |
Douglas Gregor | 41f9030 | 2010-04-12 20:54:26 +0000 | [diff] [blame] | 25 | |
Richard Smith | 7b8c3c9 | 2011-07-14 21:35:26 +0000 | [diff] [blame] | 26 | WebVector(const WebVector<T>& other) { } // expected-error{{undeclared identifier 'T'}} \ |
| 27 | expected-error{{requires a type specifier}} |
Douglas Gregor | 41f9030 | 2010-04-12 20:54:26 +0000 | [diff] [blame] | 28 | |
| 29 | template <typename C> |
Richard Smith | 7b8c3c9 | 2011-07-14 21:35:26 +0000 | [diff] [blame] | 30 | WebVector<T>& operator=(const C& other) { } // expected-error{{undeclared identifier 'T'}} |
Douglas Gregor | 41f9030 | 2010-04-12 20:54:26 +0000 | [diff] [blame] | 31 | } |