diffblue-cbmc/regression/cpp-from-CVS/Reference1/main.cpp

23 lines
192 B
C++

int g;
void function(int &ref)
{
ref=2;
}
int main()
{
int &r=g;
r=1;
assert(g==1);
function(r);
assert(g==2);
// ?: does produce an l-value, apparently
int &s=g?r:g;
}