diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/SemaTemplate/member-template-access-expr.cpp | |
parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) |
Notes
Diffstat (limited to 'test/SemaTemplate/member-template-access-expr.cpp')
-rw-r--r-- | test/SemaTemplate/member-template-access-expr.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/SemaTemplate/member-template-access-expr.cpp b/test/SemaTemplate/member-template-access-expr.cpp new file mode 100644 index 000000000000..20437aee39dc --- /dev/null +++ b/test/SemaTemplate/member-template-access-expr.cpp @@ -0,0 +1,30 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +template<typename U, typename T> +U f0(T t) { + return t.template get<U>(); +} + +template<typename U, typename T> +int &f1(T t) { + // FIXME: When we pretty-print this, we lose the "template" keyword. + return t.U::template get<int&>(); +} + +struct X { + template<typename T> T get(); +}; + +void test_f0(X x) { + int i = f0<int>(x); + int &ir = f0<int&>(x); +} + +struct XDerived : public X { +}; + +void test_f1(XDerived xd) { + // FIXME: Not quite functional yet. +// int &ir = f1<X>(xd); +} + |