File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
libcxx/test/libcxx/diagnostics Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1515#include " test_macros.h"
1616
1717#if TEST_STD_VER >= 14
18- template <typename T>
1918struct TransparentKey {
20- explicit operator T () const ;
19+ explicit operator int () const ;
2120};
2221
2322struct TransparentCompare {
2423 using is_transparent = void ; // This makes the comparator transparent
2524
26- template <typename T>
27- bool operator ()(const T&, const TransparentKey<T>&) const ;
25+ bool operator ()(const int &, const TransparentKey&) const ;
2826
29- template <typename T>
30- bool operator ()(const TransparentKey<T>&, const T&) const ;
27+ bool operator ()(const TransparentKey<T>&, const int &) const ;
3128
32- template <typename T>
33- bool operator ()(const T&, const T&) const ;
29+ bool operator ()(const int &, const int &) const ;
3430};
3531#endif
3632
@@ -89,7 +85,7 @@ void test() {
8985 std::map<int , int , TransparentCompare> tm;
9086 const std::map<int , int , TransparentCompare> ctm{};
9187
92- TransparentKey< int > tkey;
88+ TransparentKey tkey;
9389
9490 tm.find (tkey); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
9591 ctm.find (tkey); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
You can’t perform that action at this time.
0 commit comments