[llvm-bugs] [Bug 35063] New: libc++ says my user-defined type has an operator<< during sfinae - libstdc++ works as expected
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Oct 24 11:26:12 PDT 2017
https://bugs.llvm.org/show_bug.cgi?id=35063
Bug ID: 35063
Summary: libc++ says my user-defined type has an operator<<
during sfinae - libstdc++ works as expected
Product: libc++
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: xaxxon at gmail.com
CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
https://godbolt.org/g/PRfyjH
#include <type_traits>
#include <iostream>
template<typename T, typename = void>
struct has_insertion_operator : std::false_type {};
template<typename T>
struct has_insertion_operator<T,
std::void_t<decltype(
operator<<(std::declval<std::ostream>(),
std::declval<T>()))>
> : std::true_type {};
template<class T>
constexpr bool has_insertion_operator_v = has_insertion_operator<T>::value;
class A{};
static_assert(!has_insertion_operator_v<A>); // <== I expect this to pass, but
it fires on libc++.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171024/c7fe9a3c/attachment.html>
More information about the llvm-bugs
mailing list