[Bug c++/107175] New: overloaded resolution has a bug incase of deleted functions
physhivam at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Oct 6 20:05:05 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107175
Bug ID: 107175
Summary: overloaded resolution has a bug incase of deleted
functions
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: physhivam at gmail dot com
Target Milestone: ---
Hey, I was trying to build clang's libcxx on my ubuntu 22.04 and it has
gcc-11.2 by default most prolly, but while building libcxx there was an error
about using the deleted function but it seems that overloaded resolution in
gcc-11 has a bug
namespace N {
struct S {};
void func(S);
}
namespace ADL {
void func() = delete;
}
template <class T>
void call_func(T t) {
using ADL::func;
func(t);
}
int main() {
call_func(N::S{});
}
error:
<source>: In instantiation of 'void call_func(T) [with T = N::S]':
<source>:18:12: required from here
<source>:14:7: error: use of deleted function 'void ADL::func()'
14 | func(t);
| ~~~~^~~
<source>:8:8: note: declared here
8 | void func() = delete;
| ^~~~
Compiler returned: 1
https://godbolt.org/z/GPTPYaobb , it consider wrong overloaded function ,
although the bug is fixed in the most recent version but I guess this needs to
be backport in the previous version where gcc starts support for c++11, as many
of the previous versions are the default versions on several machines.
More information about the Gcc-bugs
mailing list