aboutsummaryrefslogtreecommitdiff
path: root/tests/xok/supertmpl.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-07-18 21:33:50 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-07-18 21:33:50 +0300
commit94b767679fc68c51aa0c80bdada35b9978989199 (patch)
tree711af40c89140a9add7db30cf6a81861a3df1013 /tests/xok/supertmpl.c
parent1564f79cfc7d790e15298d28f52b4c5c216ce9e5 (diff)
downloadngc-94b767679fc68c51aa0c80bdada35b9978989199.tar.gz
ngc-94b767679fc68c51aa0c80bdada35b9978989199.zip
add supertemplate handling
Diffstat (limited to 'tests/xok/supertmpl.c')
-rw-r--r--tests/xok/supertmpl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/xok/supertmpl.c b/tests/xok/supertmpl.c
new file mode 100644
index 0000000..bc946fb
--- /dev/null
+++ b/tests/xok/supertmpl.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+typedef tmpl[](){
+ int <>_ok()
+ {
+ return 20;
+ }
+};
+
+typedef supertmpl[]() = tmpl[]() {
+ int <>_superok()
+ {
+ return <>_ok();
+ }
+};
+
+typedef inst = supertmpl[]();
+
+int main()
+{
+ int ok = inst_superok();
+ if (ok == 20)
+ puts("OK");
+}