blob: b3f41be7bfadcecbe80e989f9ea0166bcbdbd682 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Douglas Gregorfd2300e2009-10-29 17:56:10 +00002// PR5336
3template<typename FromCl>
4struct isa_impl_cl {
5 template<class ToCl>
6 static void isa(const FromCl &Val) { }
7};
8
9template<class X, class Y>
10void isa(const Y &Val) { return isa_impl_cl<Y>::template isa<X>(Val); }
11
12class Value;
13void f0(const Value &Val) { isa<Value>(Val); }
Douglas Gregor8a4386b2009-11-04 23:20:05 +000014
15// Implicit template-ids.
16template<typename T>
17struct X0 {
18 template<typename U>
19 void f1();
20
21 template<typename U>
22 void f2(U) {
23 f1<U>();
24 }
25};
26
27void test_X0_int(X0<int> xi, float f) {
28 xi.f2(f);
29}
Douglas Gregorae4c77d2010-02-05 19:11:37 +000030
31// Not template-id expressions, but they almost look like it.
32template<typename F>
33struct Y {
34 Y(const F&);
35};
36
37template<int I>
38struct X {
39 X(int, int);
40 void f() {
41 Y<X<I> >(X<I>(0, 0));
42 Y<X<I> >(::X<I>(0, 0));
43 }
44};
45
46template struct X<3>;