Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron
Reference (section label): [basic.def.odr]
Issue description:
Consider the following two translation units:
//TU 1
struct S{};
inline S foo(){
return S(),S();
}
//TU 2
#include<iostream>
struct S{};
S operator,(S,S){
std::cout<<"called\n";
return{};
}
inline S foo(){
return S(),S();
}
This should probably be IFNDR, but there does not actually appear to be anything that makes it ill-formed. "In each such definition, the overloaded operators referred to, the implicit calls to conversion functions, constructors, operator new functions and operator delete functions, shall refer to the same function." [basic.def.odr]/16.10 is the closest thing, but it appears that it assumes two functions are used. Unary operator& is another scenario where a built in operator can be mixed with an overloaded operator. Additionally, consider the following two translation units:
//TU 1
struct B;
struct C;
inline B*bar(C*p){
return(B*)p;
}
//TU 2
struct A{int x;};
struct B{int y;};
struct C:A,B{};
inline B*bar(C*p){
return(B*)p;
}
This should probably be IFNDR as well, but there does not appear to be anything that makes it ill-formed. See also: #990
Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron
Reference (section label): [basic.def.odr]
Issue description:
Consider the following two translation units:
This should probably be IFNDR, but there does not actually appear to be anything that makes it ill-formed. "In each such definition, the overloaded operators referred to, the implicit calls to conversion functions, constructors, operator new functions and operator delete functions, shall refer to the same function." [basic.def.odr]/16.10 is the closest thing, but it appears that it assumes two functions are used. Unary
operator&is another scenario where a built in operator can be mixed with an overloaded operator. Additionally, consider the following two translation units:This should probably be IFNDR as well, but there does not appear to be anything that makes it ill-formed. See also: #990