This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Prefer __nullptr to the current fallback implementation in C++03 to prevent ABI issues.
AbandonedPublic

Authored by EricWF on Jul 10 2015, 4:48 PM.

Details

Reviewers
mclow.lists
Summary

The fallback version of nullptr provided by libc++ has a different mangled name than the real thing. This can cause ABI issues between code compiled in C++03 and C++11. This problem can be fixed when using Clang as the compiler. Clang provides 'nullptr' as an alternate keyword that is available in all C++ dialects. We should prefer using 'nullptr' instead of our own fallback type.

However this change is ABI breaking for any user who already depends the C++03 nullptr_t mangled name. Should we hold this change back until we better understand how to manage ABI changes?

Diff Detail

Event Timeline

EricWF updated this revision to Diff 29504.Jul 10 2015, 4:48 PM
EricWF retitled this revision from to [libcxx] Prefer __nullptr to the current fallback implementation in C++03 to prevent ABI issues..
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.
mclow.lists edited edge metadata.Jul 10 2015, 7:59 PM

However this change is ABI breaking for any user who already depends the C++03 nullptr_t mangled name.

Also, this is a breaking change for anyone who mixes clang and gcc.

EricWF abandoned this revision.Jul 18 2015, 11:34 AM

After discussion with @mclow.lists we agree that this patch should not be applied right now.