summaryrefslogtreecommitdiff
path: root/kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc')
-rw-r--r--kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc b/kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc
new file mode 100644
index 000000000..845cf6c65
--- /dev/null
+++ b/kythe/cxx/indexer/cxx/testdata/tvar_template/template_fn_spec.cc
@@ -0,0 +1,10 @@
+// Tests explicit specialization of function templates.
+// Note that function templates do not support partial specialization.
+//- @id defines/binding PrimaryTemplate
+template <typename T> T id(T x) { return T(); }
+//- @id defines/binding SpecTemplate
+template <> int id(int x) { return x; }
+//- SpecTemplate specializes TAppPTInt
+//- TAppPTInt.node/kind tapp
+//- TAppPTInt param.0 PrimaryTemplate
+//- TAppPTInt param.1 vname("int#builtin",_,_,_,_)