diff options
Diffstat (limited to 'tests/diagnostics')
| -rw-r--r-- | tests/diagnostics/inheritance-1.slang | 13 | ||||
| -rw-r--r-- | tests/diagnostics/inheritance-2.slang | 10 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/diagnostics/inheritance-1.slang b/tests/diagnostics/inheritance-1.slang new file mode 100644 index 000000000..c811623d8 --- /dev/null +++ b/tests/diagnostics/inheritance-1.slang @@ -0,0 +1,13 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +// Tests that we will diagnose a warning on struct inheritance being unstable +// before Slang 2026. + +#lang 2025 + +struct Base {} + +//CHECK: ([[# @LINE+1]]): warning 30816: +struct Derived : Base {} + +struct Base1 {}
\ No newline at end of file diff --git a/tests/diagnostics/inheritance-2.slang b/tests/diagnostics/inheritance-2.slang new file mode 100644 index 000000000..6b1bcfaff --- /dev/null +++ b/tests/diagnostics/inheritance-2.slang @@ -0,0 +1,10 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +// Tests that we will diagnose an error on struct inheritance in language 2026 or later. + +#lang 2026 + +struct Base {} + +//CHECK: ([[# @LINE+1]]): error 30811: +struct Derived : Base {} |
