CWG Issue 678 (original) (raw)

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13


678. Language linkage of member function parameter types and the ODR

Section: 6.3 [basic.def.odr]Status: C++11Submitter: James WidmanDate: 15 February, 2008

[Voted into WP at August, 2010 meeting.]

I thought this case would result in undefined behavior according to 6.3 [basic.def.odr]:

// t.h:
struct A { void (*p)(); };

// t1.cpp:
#include "t.h" // A::p is a pointer to C++ func

// t2.cpp:
extern "C" {
#include "t.h" // A::p is a pointer to C func
}

...but I don't see how any of the bullets in the list in paragraph 5 apply.

Proposed resolution (March, 2010):

Add a new bullet following 6.3 [basic.def.odr] paragraph 5, second bullet:

...Given such an entity named D defined in more than one translation unit, then