summaryrefslogtreecommitdiff
path: root/libbindgen/tests
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2016-12-28 11:58:29 +1100
committerXidorn Quan <me@upsuper.org>2016-12-28 12:01:53 +1100
commit912abe5b584960e9c15a3cd050f965ab69bf5f7e (patch)
treee76647498967883c068199869754eb82ebdb7ed6 /libbindgen/tests
parent3ba3a76f8c7f393c81bc14eb497ae2b3047ead98 (diff)
ir: Skip function template earlier.
This should fix #364.
Diffstat (limited to 'libbindgen/tests')
-rw-r--r--libbindgen/tests/expectations/tests/template_function_with_auto.rs10
-rw-r--r--libbindgen/tests/headers/template_function_with_auto.hpp9
2 files changed, 19 insertions, 0 deletions
diff --git a/libbindgen/tests/expectations/tests/template_function_with_auto.rs b/libbindgen/tests/expectations/tests/template_function_with_auto.rs
new file mode 100644
index 00000000..b86d8224
--- /dev/null
+++ b/libbindgen/tests/expectations/tests/template_function_with_auto.rs
@@ -0,0 +1,10 @@
+/* automatically generated by rust-bindgen */
+
+
+#![allow(non_snake_case)]
+
+
+extern "C" {
+ #[link_name = "_Z5Test2v"]
+ pub fn Test2() -> ::std::os::raw::c_uint;
+}
diff --git a/libbindgen/tests/headers/template_function_with_auto.hpp b/libbindgen/tests/headers/template_function_with_auto.hpp
new file mode 100644
index 00000000..3bd4a64f
--- /dev/null
+++ b/libbindgen/tests/headers/template_function_with_auto.hpp
@@ -0,0 +1,9 @@
+// bindgen-flags: -- -std=c++14
+
+template<typename T> auto Test1() {
+ return T(1);
+}
+
+auto Test2() {
+ return Test1<unsigned int>();
+}