You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
333 B
C++

#include <cassert>
int test = 12;
int fnord_(const int i) {
test += i;
return test;
}
int& fnord(const int i) {
test += i;
return test;
}
int main() {
test = 13;
fnord_(5);
assert(test == 18);
// LOLNOPE:
// fnord_(5)++;
test = 13;
fnord(5);
assert(test == 18);
fnord(5)++;
assert(test == 24);
}