[PATCH] D53879: Make libc++'s versioning namespace customizable

Shoaib Meenai via Phabricator reviews at reviews.llvm.org
Tue Oct 30 14:10:59 PDT 2018


smeenai added inline comments.


================
Comment at: CMakeLists.txt:685
+if (NOT LIBCXX_ABI_NAMESPACE STREQUAL "")
+  if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*")
+    message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
----------------
ldionne wrote:
> EricWF wrote:
> > ldionne wrote:
> > > `__.+`? Or do we want to allow `__`?
> > In addition do we want `_Foo`. My thinking is we should probably allow users to foot-gun themselves as much as they want. 
> > 
> > We should probably document that we make no promises that we don't introduce names which conflict with their custom namespace name.
> Actually, that's interesting. Another possibility would be to only allow users to use names that we can promise we won't reuse. For example we could say `__x.+` is reserved for users, or something like that.
> 
> What we should really avoid is for someone to start using something like `__3`, which would conflict with something we want to use in the future. Even though it would be their problem in theory, in practice it might put pressure on us not to reuse the name (if it were an important vendor or something). Constraining what names they can use would clear this possibility out completely.
I would strongly prefer the allowed names to not be that restricted, since existing custom inline namespaces might not confirm to it (our doesn't). Allowing `__` followed by anything would work for us.


Repository:
  rCXX libc++

https://reviews.llvm.org/D53879





More information about the libcxx-commits mailing list