Changes between Initial Version and Version 1 of Ticket #189


Ignore:
Timestamp:
Jul 3, 2020, 2:25:52 PM (3 years ago)
Author:
mlbrooks
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #189

    • Property Summary changed from Reference types allow unsound assignment to Reference and pointer types allow unsound initialization
  • Ticket #189 – Description

    initial v1  
    3232
    3333Actual: Compiler success; program prints 1078523331.
     34
     35This behaviour also occurs with pointers.  Furthermore, this example is trimmed such that it can run with -n (no prelude).
     36
     37{{{
     38struct A {};
     39struct B {};
     40
     41void f() {
     42    A * ap;
     43    B * bp = ap; // not sound
     44}
     45}}}
     46
     47Expected: Compiler error at "not sound" line, saying cannot initialize B* from A*.
     48
     49Actual: `cfa-cpp -n -P astexpr -P ascodegen` produces output in which the "unsound" line is `B *_X2bpPS1B_2 = ((B *)_X2apPS1A_2);`.