aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-07-31 00:30:00 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-07-31 17:02:12 +0000
commitf446a79410b81067c982dc48563e2acccded1247 (patch)
tree862d463f7dbfa7e8c412eba523181225a683e0a2 /tests/manual
parent60007e4a9db9ead75a533ca6bff369716fe70dda (diff)
Work around ICC 16 beta compiler bug in SFINAE expansion
Calling std::vector<int>'s constructor (or assign()) with two ints can select one of two different overloads: the (size_t, value_type) overload which fills with n copies of the value or (iterator, iterator) overload, which would copy a range. libstdc++ had some workarounds for this scenario, by using an indirect dispatch to determine whether it was a pair of integrals or not. But ever since the resolution of DR1234 (https://gcc.gnu.org/bugzilla/ show_bug.cgi?id=43813) with C++11's more expressive SFINAE, the dispatching is done actually by the outer template by adding an extra template parameter that requires std::iterator_traite<T> to expand. That's where ICC fails: it expands std::iterator_traits<int> and that fails. It should have ignored the expansion and discarded that overload. The workaround is simple: pass different types as the parameters, which means the compiler cannot select the overload containing a pair of iterators. /usr/include/c++/5/bits/stl_iterator_base_types.h(154): error: name followed by "::" must be a class or namespace name typedef typename _Iterator::iterator_category iterator_category; ^ detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163 instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 876 of "compiler/qv4ssa.cpp" Change-Id: I52dd43c12685407bb9a6ffff13f5f783820213a5 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'tests/manual')
0 files changed, 0 insertions, 0 deletions