This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80601] spurious -Wconversion warning with explicit class template arguments
- 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: Wed, 03 May 2017 10:05:14 +0000
- Subject: [Bug c++/80601] spurious -Wconversion warning with explicit class template arguments
- Auto-submitted: auto-generated
- References: <bug-80601-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80601
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-05-03
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I suspect this is another consequence of
https://gcc.gnu.org/gcc-7/porting_to.html#hypothetical-instantiation
Strictly speaking the compiler is correct that the type of sizeof(T) is not
dependent, so for LP64 targets will always need a conversion to a narrower
type.
But the warning does seem unhelpful in this case, as it's almost certain that
any instantiation of the function template will produce a value that does fit
in unsigned.