summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-function-1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-14 23:26:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-14 23:26:13 +0000
commitb4850465b77f98dce508201c938b7222ed878331 (patch)
tree5c0a8def5dbd729b776c6dd7d2e32f7df51d0edd /clang/test/SemaTemplate/instantiate-function-1.cpp
parent35ea2c9aa687f5ad36428b3a6dc147a72cf7eeb0 (diff)
downloadbcm5719-llvm-b4850465b77f98dce508201c938b7222ed878331.tar.gz
bcm5719-llvm-b4850465b77f98dce508201c938b7222ed878331.zip
Introduce basic support for instantiating the definitions of member
functions of class templates. Only compound statements and expression statements are currently implemented. llvm-svn: 71814
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-function-1.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp
new file mode 100644
index 00000000000..61b361f894a
--- /dev/null
+++ b/clang/test/SemaTemplate/instantiate-function-1.cpp
@@ -0,0 +1,14 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename T, typename U>
+struct X0 {
+ void f(T x, U y) {
+ x + y; // expected-error{{invalid operands}}
+ }
+};
+
+struct X1 { };
+
+template struct X0<int, float>;
+template struct X0<int*, int>;
+template struct X0<int X1::*, int>; // expected-note{{instantiation of}}
OpenPOWER on IntegriCloud