This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77563] [5/6/7 Regression] explicit constructor breaks narrowing conversion overload resolution
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Sep 2016 08:42:36 +0000
- Subject: [Bug c++/77563] [5/6/7 Regression] explicit constructor breaks narrowing conversion overload resolution
- Auto-submitted: auto-generated
- References: <bug-77563-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77563
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-09-13
Known to work| |4.5.4
Summary|explicit constructor breaks |[5/6/7 Regression] explicit
|narrowing conversion |constructor breaks
|overload resolution |narrowing conversion
| |overload resolution
Ever confirmed|0 |1
Known to fail| |5.4.0, 6.2.0, 7.0
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
4.5.4 got this right:
ex.cc: In function ‘int main()’:
ex.cc:15:7: error: conversion from ‘long int’ to ‘A’ is ambiguous
ex.cc:6:3: note: candidates are: A::A(uint32_t)
ex.cc:5:3: note: A::A(int32_t)
Since GCC 4.6 the error has been misleading, and since GCC 6 it's
accepts-invalid.