aboutsummaryrefslogtreecommitdiff
path: root/testsuite/fail_compilation
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-11-18 00:10:23 +0100
committerEugen Wissner <belka@caraus.de>2026-11-20 00:08:40 +0100
commitd4681529c20d5cb2630bfe09f4cf4c4ca4c98a23 (patch)
treed11bc100c2e35fe7ee8e84837d8e2826e4b8731e /testsuite/fail_compilation
parent9b4b13e0d9030bb21c86eea6c4ba00bf4d91f0a0 (diff)
downloadelna-cpp.tar.gz
Restrict pointer subtraction by typeHEADcpp
Diffstat (limited to 'testsuite/fail_compilation')
-rw-r--r--testsuite/fail_compilation/pointer_subtraction_mismatch.elna10
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuite/fail_compilation/pointer_subtraction_mismatch.elna b/testsuite/fail_compilation/pointer_subtraction_mismatch.elna
new file mode 100644
index 0000000..5ad1dcb
--- /dev/null
+++ b/testsuite/fail_compilation/pointer_subtraction_mismatch.elna
@@ -0,0 +1,10 @@
+program()
+
+var
+ p: ^Int
+ q: ^Word
+ diff: Int
+
+begin
+ diff := p - q (* @Error Invalid operands of type '\^Int' and '\^Word' for operator - *)
+end.