Ignore:
Timestamp:
Nov 20, 2017, 4:03:55 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
1ba5803
Parents:
cdbfab0
Message:

Prevent implicit conversion of void * to other pointer type for parameter passing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/completeTypeError.c

    rcdbfab0 r4d5e57b  
    1212        void *v;
    1313
    14         // A * x;
    15         // A * y;
    16         // B * x;
    17         // B * z;
     14        A * x;
     15        A * y;
     16        B * x;
     17        B * z;
    1818
    1919        // okay
    2020        *i;
    21         // *x; // picks B
    22         // *z;
     21        *x; // picks B
     22        *z;
    2323        foo(i);
    2424        bar(i);
     
    2929        bar(v);
    3030        qux(v);
    31         foo(v); // questionable, but works at the moment for C compatibility
    3231
    3332        // bad
    3433        *v;
    35         // *y;
     34        *y;
     35        foo(v);
    3636        baz(v);
    3737        quux(v);
Note: See TracChangeset for help on using the changeset viewer.