https://bugs.llvm.org/show_bug.cgi?id=33389
Bug ID: 33389
Summary: __is_transparent check requires too much
Product: libc++
Version: 4.0
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: rs2...@gmail.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
__is_transparent checks for the nested is_transparent typedef by attempting to
form a pointer to it. That means it gives the wrong answer in cases where
key_compare::is_transparent "is valid and denotes a type" to which a
pointer cannot be formed (such as reference types and abominable function
types).
#include <functional>
#include <set>
enum class Test {};
bool operator<(int, Test) { return true; }
bool operator<(Test, int) { return false; }
struct evil_less : std::less<> {
using is_transparent = void() const &; //int& breaks, too.
};
int main() {
std::set<int, evil_less> s;
s.find(Test{});
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs