This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85612] New: ADL lookup with parameter pack and defaulted argument not considered ambiguous
- From: "barry.revzin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 May 2018 15:01:21 +0000
- Subject: [Bug c++/85612] New: ADL lookup with parameter pack and defaulted argument not considered ambiguous
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85612
Bug ID: 85612
Summary: ADL lookup with parameter pack and defaulted argument
not considered ambiguous
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: barry.revzin at gmail dot com
Target Milestone: ---
Hopefully-minimal example:
#ifdef WORKS
template <typename... T, typename R=int>
R foo(T&&...) {
return 0;
}
#else
template <typename... T>
decltype(auto) foo(T&&...) {
return 0;
}
#endif
namespace N {
struct X { };
template <typename... T>
void foo(T&&...) = delete;
}
int main() {
foo(N::X{});
}
gcc accepts this program with -DWORKS, but this should be ambiguous between
::foo and N::foo. It correctly rejects without -DWORKS. clang rejects in both
cases.
The parameter pack is significant somehow too, if the parameter list were just
T&& instead of T&&..., gcc rejects as ambiguous with -DWORKS too.