-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Full name of submitter (unless configured in github; will be published with the issue): Jim X
Since [lex.phases] p1.9 says:
All external entity references are resolved. Library components are linked to satisfy external references to entities not defined in the current translation.
and [dcl.link] says we can link to that entity. Consider this case:
extern "C"{
void fun();
}
int main(){
fun(); // #1
}// impl.S
.globl _fun
_fun:
retWhat's the behavior at #1? Is it implementation-defined or unspecified behavior, or just UB? Because this is a well-formed program, according to [intro.abstract] p5, it must have some observable behaviors. However, the current standard says nothing in this case.
Suggested Resolution
[dcl.link] p10 may be changed to cover this case
Linkage from C++ to objects/functions defined in other languages and to objects/functions defined in C++ from other languages is implementation-defined and language-dependent.
Then, the implementation should be responsible for telling the complete story.