[Bug c++/67358] const makes the code behavior changes
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Aug 26 09:19:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67358
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Not a bug, that's how C++ works.
The argument p is a non-const int, so binding const int& requires a
qualification conversion. The function template deduces the parameter type as
int& which is an exact match requiring no conversion, so is a better conversion
sequence.
I suggest asking this kind of question somewhere like stackoverflow.com instead
of reporting a bug.
More information about the Gcc-bugs
mailing list