summaryrefslogtreecommitdiff
path: root/tests/compile
diff options
context:
space:
mode:
authorisotherm <kirk.meyer@alpaxo.com>2020-04-25 00:58:18 -0500
committerStefan Behnel <stefan_ml@behnel.de>2020-04-25 07:59:38 +0200
commit9e26b370f2bf4d9aea29a9d29bcac0955ebb632c (patch)
tree226623c60d876c8766f5473b6cce76fe402c73f5 /tests/compile
parent049f839dfc2b41d6c431eb4e55bf0f1fc5e30683 (diff)
downloadcython-9e26b370f2bf4d9aea29a9d29bcac0955ebb632c.tar.gz
FIX: Ignore unused ctuples (GH-3543) (GH-3551)
generate_type_definitions maintained a list of ctuples for which code was already generated, but the logic did not match the logic used in generate_type_header_code, which does not generate code if the entry is marked as unused. If the first ctuple of a certain type was marked unused, but later instances were not, this could result in no code being generated for the ctuple at all. Resolve by verifying whether the ctuple entry is used before adding it to the list. Co-authored-by: Kirk Meyer <kirk.meyer@ravenind.com>
Diffstat (limited to 'tests/compile')
-rw-r--r--tests/compile/ctuple_unused_T3543.pyx9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/compile/ctuple_unused_T3543.pyx b/tests/compile/ctuple_unused_T3543.pyx
new file mode 100644
index 000000000..88446dd64
--- /dev/null
+++ b/tests/compile/ctuple_unused_T3543.pyx
@@ -0,0 +1,9 @@
+# ticket: 3543
+# mode: compile
+
+# Views define unused ctuples, including (long,)
+from cython cimport view
+
+# Implicitly generate a ctuple (long,)
+obj = None
+obj or (1,)