[Bug c++/91431] Using class template for containers and iterators rather than defining template only for iterators caused a trouble
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 13 12:01:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91431
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-reduction |ice-on-invalid-code
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:
template<typename T> class Blob {
public:
template<
template<typename> class Alloc,
template<typename, typename = Alloc<T>> class Container,
class Iter = typename Container<T>::iterator
> Blob(Iter b, Iter e) {
}
private:
};
int main()
{
int i = 0;
Blob<int> i_blob(&i, &i);
}
The code is invalid, you can't deduce the container and allocator from the
iterator type like that.
More information about the Gcc-bugs
mailing list