https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86186
Bug ID: 86186
Summary: Unqualified calls of std::get lead to ADL issues
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: zhonghao at pku dot org.cn
Target Milestone: ---
The sample code is as follow:
#include <tuple>
#include <utility>
namespace foo {
struct bar { bool operator==(bar) const { return true; } };
template <std::size_t I>
struct hard_error { static_assert(I > 0, ""); using type = void; };
template <std::size_t I, typename T>
typename hard_error<I>::type get(T) {}
}
int main()
{
std::tuple<foo::bar, int> t1, t2;
t1 == t2; // error: static_assert failed ""
// note: in instantiation of template class 'foo::hard_error<0>'
// note: while substituting explicitly-specified template arguments into
function template 'get'
}
A previous version of clang++ does not produce any error messages for the above
code, but it was fixed in https://bugs.llvm.org/show_bug.cgi?id=20092