diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-05-10 13:35:00 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-05-10 13:35:00 +0000 |
| commit | ec39296875b0723de6eeee1d5669617256bf2e7d (patch) | |
| tree | 137b1f70bf66768817dd0cf7e7c15cc69bec4467 /libcxx/test/std/containers/associative/set | |
| parent | cd26846fc54c18128f992b9ee7a9771410255f41 (diff) | |
| download | bcm5719-llvm-ec39296875b0723de6eeee1d5669617256bf2e7d.tar.gz bcm5719-llvm-ec39296875b0723de6eeee1d5669617256bf2e7d.zip | |
Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase
llvm-svn: 236950
Diffstat (limited to 'libcxx/test/std/containers/associative/set')
| -rw-r--r-- | libcxx/test/std/containers/associative/set/erase_iter.pass.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/associative/set/erase_iter.pass.cpp b/libcxx/test/std/containers/associative/set/erase_iter.pass.cpp index 21666c36401..36828be86f2 100644 --- a/libcxx/test/std/containers/associative/set/erase_iter.pass.cpp +++ b/libcxx/test/std/containers/associative/set/erase_iter.pass.cpp @@ -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 } |

