source: tests/.expect/init1.txt @ 442b624

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 442b624 was b81fd95, checked in by Michael Brooks <mlbrooks@…>, 4 years ago

Fix bug where pointer and reference types allow unsound initialization and return. Fixes #189

There are two instances of the same basic change, which is using conversionCost instead of castCost for resolving...
A: an InitExpr?, always; affects variable initializations
B: a CastExpr?, for type-system-generated casts only; affects function returns

Changing the behaviour of the typechecker on initialization (do A) and cast (do B):
src/ResolvExpr/AlternativeFinder.cc
src/SynTree/Expression.h
testsinit1.*

Making type of string literal consistent with how C defines it (accommodate A):
src/Parser/ExpressionNode.cc

Making type system happy with incumbent use of void* (accommodate A):
libcfa/src/concurrency/kernel.cfa
libcfa/src/containers/list.hfa
tests/bugs/66.cfa
tests/avltree/avl1.cfa
tests/concurrent/signal/block.cfa
tests/searchsort.cfa

Making type system happy with incumbent plan-9 downcast (accommodate B):
libcfa/src/containers/list.hfa

Fixing previously incorrect constness of declarations (accommodate A):
tests/exceptions/defaults.cfa
libcfa/src/iostream.hfa

Fixing previously incorrect isGenerated classification of casts that desugaring introduces (accommodate B):
src/Concurrency/Keywords.cc
src/Concurrency/Waitfor.cc

Working around trac #207 (revealed by A):
tests/io2.cfa

Working around trac #208 (speculatively created by B):
libcfa/src/bits/locks.hfa
libcfa/src/concurrency/preemption.cfa

Misc:
tests/exceptions/conditional.cfa (accommodate A)

a _msg function for an exception was declared with wrong return type, so it was not compatible for assignment into the vtable instance

libcfa/src/stdlib.hfa

the compiler now prohibits a prior attempt to call a nonexistent realloc overload; calling alloc_align in its place

  • Property mode set to 100644
File size: 1.6 KB
Line 
1error: No reasonable alternatives for expression Untyped Init Expression
2  Name: rx  InitAlternative: reference to signed int
3error: No reasonable alternatives for expression Untyped Init Expression
4  Name: px  InitAlternative: pointer to signed int
5error: No reasonable alternatives for expression Untyped Init Expression
6  Name: crx  InitAlternative: reference to float
7error: No reasonable alternatives for expression Untyped Init Expression
8  Name: cpx  InitAlternative: pointer to float
9init1.cfa:94:1 error: No reasonable alternatives for expression Generated Cast of:
10  Name: rx
11... to:
12  reference to signed int
13init1.cfa:97:1 error: No reasonable alternatives for expression Applying untyped:
14  Name: ?{}
15...to:
16  Generated Cast of:
17    Variable Expression: _retval_f_py: pointer to signed int
18  ... to:
19    reference to pointer to signed int
20  Name: px
21
22init1.cfa:104:1 error: No reasonable alternatives for expression Generated Cast of:
23  Name: crx
24... to:
25  reference to float
26init1.cfa:107:1 error: No reasonable alternatives for expression Applying untyped:
27  Name: ?{}
28...to:
29  Generated Cast of:
30    Variable Expression: _retval_f_py2: pointer to float
31  ... to:
32    reference to pointer to float
33  Name: cpx
34
35init1.cfa:114:1 error: No reasonable alternatives for expression Generated Cast of:
36  Name: s
37... to:
38  reference to instance of type T (not function type)
39init1.cfa:118:1 error: No reasonable alternatives for expression Applying untyped:
40  Name: ?{}
41...to:
42  Generated Cast of:
43    Variable Expression: _retval_anycvt: pointer to instance of type T (not function type)
44  ... to:
45    reference to pointer to instance of type T (not function type)
46  Name: s
47
Note: See TracBrowser for help on using the repository browser.