Title
Language linkage of names of functions with internal linkage
Status
nad
Section
9.11 [dcl.link]
Submitter
Richard Smith

Created on 2013-06-17.00:00:00 last changed 136 months ago

Messages

Date: 2013-09-15.00:00:00

Rationale (September, 2013):

There was no consensus in CWG for a change to the current rules. 9.11 [dcl.link] paragraph 6 should be read as applying to the C language linkage of the name, not the function type.

Date: 2022-11-20.07:54:16

Issue 4 separated the concepts of language linkage for names and language linkage for types; since the names of functions with internal linkage are not visible outside their (C++) translation unit, there is no need to restrict overloading of extern "C" functions with internal linkage, e.g.,

  extern "C" {
    static void f();
    static void f(int);
  }

although the types of such functions still have C language linkage and thus can be called via a function pointer from C code.

The change permitting such overloading, however, has not been widely implemented since the resolution of issue 4, leading some to suggest that the unnecessary restriction on function overloading of such functions should be reimposed.

If it is decided to keep the resolution of issue 4, 9.11 [dcl.link] paragraph 6 should be clarified:

At most one function with a particular name can have C language linkage.

Presumably this was overlooked in implementing the intent of the resolution for the issue and is a likely explanation for the reason it is not more widely implemented.

History
Date User Action Args
2013-10-14 00:00:00adminsetmessages: + msg4709
2013-10-14 00:00:00adminsetstatus: open -> nad
2013-06-17 00:00:00admincreate