blob: 5f8d8caae698bc3e8a8d8fcccc58c375f681166f [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregora786fdb2009-10-13 23:27:22 +00002
3// PR3990
4namespace N {
5 struct Wibble {
6 };
7
8 typedef Wibble foo;
9}
10using namespace N;
11
John McCall7c2342d2010-03-10 11:27:22 +000012foo::bar x; // expected-error{{no type named 'bar' in 'N::Wibble'}}
Douglas Gregora786fdb2009-10-13 23:27:22 +000013
14void f() {
John McCall7c2342d2010-03-10 11:27:22 +000015 foo::bar = 4; // expected-error{{no member named 'bar' in 'N::Wibble'}}
Douglas Gregora786fdb2009-10-13 23:27:22 +000016}
17
18template<typename T>
19struct A {
20 typedef T type;
21
22 type f();
23};
24
25template<typename T>
26A<T>::type g(T t) { return t; } // expected-error{{missing 'typename'}}
27
28template<typename T>
29A<T>::type A<T>::f() { return type(); } // expected-error{{missing 'typename'}}