summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/member-function-template.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-17 05:17:33 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-17 05:17:33 +0000
commit03c5705a99a96a471b2868898ee9688a6721e02a (patch)
tree2d8c60e17f7c37c80d3e44db50196188a2a148ff /test/SemaTemplate/member-function-template.cpp
parent145e2ea10fb6240265c3fac8137a5f2b01b1a426 (diff)
downloadclang-03c5705a99a96a471b2868898ee9688a6721e02a.tar.gz
Require the object type of a member access expression ("." or "->") to
be complete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/member-function-template.cpp')
-rw-r--r--test/SemaTemplate/member-function-template.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/member-function-template.cpp b/test/SemaTemplate/member-function-template.cpp
index 756b510e97..1d46d31e35 100644
--- a/test/SemaTemplate/member-function-template.cpp
+++ b/test/SemaTemplate/member-function-template.cpp
@@ -60,3 +60,16 @@ struct Functor {
void test_Functor(Functor f) {
f(1);
}
+
+// Instantiation on ->
+template<typename T>
+struct X1 {
+ template<typename U> U& get();
+};
+
+template<typename T> struct X2; // expected-note{{here}}
+
+void test_incomplete_access(X1<int> *x1, X2<int> *x2) {
+ float &fr = x1->get<float>();
+ (void)x2->get<float>(); // expected-error{{implicit instantiation of undefined template}}
+}