summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-function-1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-function-1.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-1.cpp b/clang/test/SemaTemplate/instantiate-function-1.cpp
index 482b466e845..5ded6140a63 100644
--- a/clang/test/SemaTemplate/instantiate-function-1.cpp
+++ b/clang/test/SemaTemplate/instantiate-function-1.cpp
@@ -58,3 +58,20 @@ template<typename T> struct X5 {
void test_X5(X5<Incomplete> x5); // okay!
template struct X5<Incomplete>; // expected-note{{instantiation}}
+
+template<typename T, typename U, typename V> struct X6 {
+ U f(T t, U u, V v) {
+ // IfStmt
+ if (t > 0)
+ return u;
+ else
+ return v; // expected-error{{incompatible type}}
+ }
+};
+
+struct ConvertibleToInt {
+ operator int() const;
+};
+
+template struct X6<ConvertibleToInt, float, char>;
+template struct X6<bool, int, int*>; // expected-note{{instantiation}}
OpenPOWER on IntegriCloud