blob: 9f227c05e1d4566fbf23bb56cbbc6f20a2125b25 [file] [log] [blame]
Douglas Gregor3b6afbb2009-09-09 00:23:06 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3template<typename U, typename T>
4U f0(T t) {
5 return t.template get<U>();
6}
7
8template<typename U, typename T>
9int &f1(T t) {
10 // FIXME: When we pretty-print this, we lose the "template" keyword.
11 return t.U::template get<int&>();
12}
13
14struct X {
15 template<typename T> T get();
16};
17
18void test_f0(X x) {
19 int i = f0<int>(x);
20 int &ir = f0<int&>(x);
21}
22
23struct XDerived : public X {
24};
25
26void test_f1(XDerived xd) {
27 // FIXME: Not quite functional yet.
28// int &ir = f1<X>(xd);
29}
30
Douglas Gregordd62b152009-10-19 22:04:39 +000031// PR5213
32template <class T>
33struct A {};
34
35template<class T>
36class B
37{
38 A<T> a_;
39
40public:
41 void destroy();
42};
43
44template<class T>
45void
46B<T>::destroy()
47{
48 a_.~A<T>();
49}
50
51void do_destroy_B(B<int> b) {
52 b.destroy();
53}