blob: e91ffb52539c0029eb766241ad333bef21dea6e6 [file] [log] [blame]
Douglas Gregor1fd6d442010-05-21 23:18:07 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2template<typename T, typename U, int N>
3struct X {
4 void f(T* t) {
5 t->f0<U>(); // expected-error{{use 'template' keyword to treat 'f0' as a dependent template name}}
6 t->f0<int>(); // expected-error{{use 'template' keyword to treat 'f0' as a dependent template name}}
7
8 t->operator+<U const, 1>(); // expected-error{{use 'template' keyword to treat 'operator +' as a dependent template name}}
9 t->f1<int const, 2>(); // expected-error{{use 'template' keyword to treat 'f1' as a dependent template name}}
10
Douglas Gregord5ab9b02010-05-21 23:43:39 +000011 T::getAs<U>(); // expected-error{{use 'template' keyword to treat 'getAs' as a dependent template name}}
12 t->T::getAs<U>(); // expected-error{{use 'template' keyword to treat 'getAs' as a dependent template name}}
13
Douglas Gregor1fd6d442010-05-21 23:18:07 +000014 // FIXME: We can't recover from these yet
15 (*t).f2<N>(); // expected-error{{expected expression}}
16 (*t).f2<0>(); // expected-error{{expected expression}}
17 }
18};