Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Douglas Gregor | a786fdb | 2009-10-13 23:27:22 +0000 | [diff] [blame] | 2 | |
| 3 | // PR3990 |
| 4 | namespace N { |
| 5 | struct Wibble { |
| 6 | }; |
| 7 | |
| 8 | typedef Wibble foo; |
| 9 | } |
| 10 | using namespace N; |
| 11 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 12 | foo::bar x; // expected-error{{no type named 'bar' in 'N::Wibble'}} |
Douglas Gregor | a786fdb | 2009-10-13 23:27:22 +0000 | [diff] [blame] | 13 | |
| 14 | void f() { |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 15 | foo::bar = 4; // expected-error{{no member named 'bar' in 'N::Wibble'}} |
Douglas Gregor | a786fdb | 2009-10-13 23:27:22 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | template<typename T> |
| 19 | struct A { |
| 20 | typedef T type; |
| 21 | |
| 22 | type f(); |
| 23 | }; |
| 24 | |
| 25 | template<typename T> |
| 26 | A<T>::type g(T t) { return t; } // expected-error{{missing 'typename'}} |
| 27 | |
| 28 | template<typename T> |
| 29 | A<T>::type A<T>::f() { return type(); } // expected-error{{missing 'typename'}} |