There will be duplicated defined function error. So I think the rules are,

1. (as you said) compiler allow more than one matched function exist, but has a priority to match them;
2. (as I showed above) for const reference and non-const reference, compiler will treat them of two different functions, but for non-const value and const value, compiler will treat them as same functions.

My conclusions (1) and (2) are correct?

Originally Posted by CornedBee

int& is an exact match. const int& would have to add a const. Clearly, int& is the better match and is thus used.

1) Correct.
2) Also correct. And if you'll refer back to your recent overriding thread, I said there quite explicitly that top-level cv qualifiers don't matter in function resolution. int and const int are treated the same. int& and const int& are not, because the const is not top-level.

All the buzzt! CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law

1) Correct.
2) Also correct. And if you'll refer back to your recent overriding thread, I said there quite explicitly that top-level cv qualifiers don't matter in function resolution. int and const int are treated the same. int& and const int& are not, because the const is not top-level.