Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@236950 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,6 +18,14 @@
|
||||
|
||||
#include "min_allocator.h"
|
||||
|
||||
struct TemplateConstructor
|
||||
{
|
||||
template<typename T>
|
||||
TemplateConstructor (const T&) {}
|
||||
};
|
||||
|
||||
bool operator<(const TemplateConstructor&, const TemplateConstructor&) { return false; }
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -178,4 +186,18 @@ int main()
|
||||
assert(i == m.end());
|
||||
}
|
||||
#endif
|
||||
#if __cplusplus >= 201402L
|
||||
{
|
||||
// This is LWG #2059
|
||||
typedef TemplateConstructor T;
|
||||
typedef std::set<T> C;
|
||||
typedef C::iterator I;
|
||||
|
||||
C c;
|
||||
T a{0};
|
||||
I it = c.find(a);
|
||||
if (it != c.end())
|
||||
c.erase(it);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user