[Bug c++/78457] attempt to instantiate unused template
rs2740 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 22 01:04:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78457
TC <rs2740 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rs2740 at gmail dot com
--- Comment #1 from TC <rs2740 at gmail dot com> ---
Doesn't seem to be a bug to me. This is caused by basically the same issue as
the one noted in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69116#c2.
std::endl names a function template, so it's a nondeduced context. Deduction
for `std::ostream& operator<<(std::ostream& os, Y<Ts...> const& )` therefore
succeeds with Ts..., not otherwise deduced, deduced be to an empty pack. Then
during overload resolution the compiler instantiates the definition of `Y<>` to
see if it can be constructed from std::endl; that instantiation triggers a hard
error outside the immediate context as expected.
More information about the Gcc-bugs
mailing list