﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
209	Mutable reference to constant is not forbidden	mlbrooks		"{{{
void fred( int & i) {
    printf(""fred got:  %d\n"", i);
    i = 4;
    printf(""fred left: %d\n"", i);
}

int produce() {
    return 17;
}

int main() {
    const int i = 3;
    printf(""main a:    %d\n"", i);
    fred( i );                     // unsound
    printf(""main b:    %d\n"", i);  // i is changed!

    // we soundly allow a mutable reference to a temporary
    fred( produce() );
}
}}}


Actual: Compile succeeds, run prints:
{{{
main a:    3
fred got:  3
fred left: 4
main b:    4
fred got:  17
fred left: 4
}}}

Expected (minimal fix): Compile error, cannot get mutable reference to const i at ""unsound"" line

Further candidate feature request: Compile succeeds, run prints:
{{{
main a:    3
fred got:  3
fred left: 4
main b:    3
fred got:  17
fred left: 4
}}}

This bug was discovered during discssions about #189 and the 189 fix is not addressing this case.
"	defect	new	minor	cfa-cc	1.0			
