https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86074
Martin Liška changed:
What|Removed |Added
Status|UNCONFIRMED |WAITING
Last reconfirmed||2018-06-07
CC||jason at gcc dot gnu.org,
||marxin at gcc dot gnu.org,
||nathan at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Martin Liška ---
Note that ICC 18 also rejects with:
(33): error: function template "operator==" has already been defined
friend bool operator==(SimpleAllocator const & lhs, SimpleAllocator
const & rhs)
^
detected during:
instantiation of class "SimpleAllocator [with T=char]" at line
88 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/bits/alloc_traits.h"
instantiation of class "std::allocator_traits<_Alloc> [with
_Alloc=SimpleAllocator]" at line 52 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/ext/alloc_traits.h"
instantiation of class "__gnu_cxx::__alloc_traits<_Alloc> [with
_Alloc=SimpleAllocator]" at line 75 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/bits/basic_string.h"
instantiation of class "std::__cxx11::basic_string<_CharT, _Traits,
_Alloc> [with _CharT=char, _Traits=std::char_traits,
_Alloc=SimpleAllocator]" at line 56
(39): error: function template "operator!=" has already been defined
friend bool operator!=(SimpleAllocator const & lhs, SimpleAllocator
const & rhs)
^
detected during:
instantiation of class "SimpleAllocator [with T=char]" at line
88 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/bits/alloc_traits.h"
instantiation of class "std::allocator_traits<_Alloc> [with
_Alloc=SimpleAllocator]" at line 52 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/ext/alloc_traits.h"
instantiation of class "__gnu_cxx::__alloc_traits<_Alloc> [with
_Alloc=SimpleAllocator]" at line 75 of
"/opt/compiler-explorer/gcc-6.3.0/bin/../include/c++/6.3.0/bits/basic_string.h"
instantiation of class "std::__cxx11::basic_string<_CharT, _Traits,
_Alloc> [with _CharT=char, _Traits=std::char_traits,
_Alloc=SimpleAllocator]" at line 56
compilation aborted for (code 2)
Compiler returned: 2
Is it really a valid code snippet?