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
diff --git a/clang/test/SemaTemplate/instantiate-expr-2.cpp b/clang/test/SemaTemplate/instantiate-expr-2.cpp
index 1832fd4..80f403e 100644
--- a/clang/test/SemaTemplate/instantiate-expr-2.cpp
+++ b/clang/test/SemaTemplate/instantiate-expr-2.cpp
@@ -116,7 +116,7 @@
//Cond<true, int*, double> C; // Errors
//int V(C.foo()); // Errors
- //typedef Cond<true, int*, double>::Type Type; // Errors + CRASHES!
+ //typedef Cond<true, int*, double>::Type Type; // Errors
typedef Cond<true, int, double>::Type Type;
}
@@ -128,5 +128,5 @@
};
void test_X0(X0<int> x, IntegralConstant<int, sizeof(int)> ic) {
- x.f(5, ic);
+ x.f(5,ic);
}
diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp
new file mode 100644
index 0000000..61b361f
--- /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}}