Consider:
// tu1
struct A { static constexpr const char *p = "foo"; };
const char *q = A::p;
// tu2
struct A { static constexpr const char *p = "foo"; };
const char *r = A::p;
We are required to ensure that q == r, but gcc, clang, and EDG all fail to
do so. Therefore we presumably need to give the string literal a mangled
name. Likewise for string literals which appear within constexpr function
bodies:
// tu1
constexpr const char *get() { return "bar"; }
const char *a = get();
// tu2
constexpr const char *get() { return "bar"; }
const char *b = get();
... and also for lifetime-extended temporaries:
struct X { int n; };
struct B { static constexpr X &&x = {0}; };
X &y = B::x; // must be same X object in all TUs
(Both Clang and g++ have a rejects-valid on this, but EDG accepts it.)
... and likewise for lifetime-extended arrays underlying
std::initializer_list objects.
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev