diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2015-01-26 11:18:14 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2015-01-26 11:18:14 +0000 |
commit | c7ac7ddaa97d6e0a00a9ce554cd64ce9f167519a (patch) | |
tree | 47e31bc217b0f4f0d6bd8527f74d0bbea96a891e | |
parent | 04385d25c2da83dcd197649af5d1b3836f4a4323 (diff) | |
download | gcc-c7ac7ddaa97d6e0a00a9ce554cd64ce9f167519a.zip gcc-c7ac7ddaa97d6e0a00a9ce554cd64ce9f167519a.tar.gz gcc-c7ac7ddaa97d6e0a00a9ce554cd64ce9f167519a.tar.bz2 |
2.cc: Add test for non-transparent comparison function.
* testsuite/23_containers/set/operations/2.cc: Add test for
non-transparent comparison function.
From-SVN: r220107
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/set/operations/2.cc | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1620f4e..6b2124a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2015-01-26 Jonathan Wakely <jwakely@redhat.com> + + * testsuite/23_containers/set/operations/2.cc: Add test for + non-transparent comparison function. + 2015-01-25 Oleg Endo <olegendo@gcc.gnu.org> PR target/29366 diff --git a/libstdc++-v3/testsuite/23_containers/set/operations/2.cc b/libstdc++-v3/testsuite/23_containers/set/operations/2.cc index 752bc7d..84ddd1f 100644 --- a/libstdc++-v3/testsuite/23_containers/set/operations/2.cc +++ b/libstdc++-v3/testsuite/23_containers/set/operations/2.cc @@ -128,6 +128,22 @@ test05() VERIFY( Cmp::count == 0); } +void +test06() +{ + // https://gcc.gnu.org/ml/libstdc++/2015-01/msg00176.html + // Verify the new function template overloads do not cause problems + // when the comparison function is not transparent. + struct I + { + int i; + operator int() const { return i; } + }; + + std::set<int> s; + I i = { }; + s.find(i); +} int main() @@ -137,4 +153,5 @@ main() test03(); test04(); test05(); + test06(); } |