This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67358] const makes the code behavior changes


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]