aboutsummaryrefslogtreecommitdiff
path: root/docs/DesignDocs/VisibilityMacros.rst
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-07-19 07:02:49 +0000
commit97a708bebca0e58714a1e005445ff28d0c1c2ca5 (patch)
treeca5965646804934581ceb1c2894df9431a357e8c /docs/DesignDocs/VisibilityMacros.rst
parent289ae9e3ac13cefd468cfb852e8b9f52e984de08 (diff)
Vendor import of libc++ trunk r308421:vendor/libc++/libc++-trunk-r308421
Diffstat (limited to 'docs/DesignDocs/VisibilityMacros.rst')
-rw-r--r--docs/DesignDocs/VisibilityMacros.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/DesignDocs/VisibilityMacros.rst b/docs/DesignDocs/VisibilityMacros.rst
index 694882dd2638..993ce2cca5fd 100644
--- a/docs/DesignDocs/VisibilityMacros.rst
+++ b/docs/DesignDocs/VisibilityMacros.rst
@@ -90,20 +90,21 @@ Visibility Macros
The macro has an empty definition with GCC.
**Windows Behavior**: `extern template` and `dllexport` are fundamentally
- incompatible *on a template class* on Windows; the former suppresses
+ incompatible *on a class template* on Windows; the former suppresses
instantiation, while the latter forces it. Specifying both on the same
- declaration makes the template class be instantiated, which is not desirable
+ declaration makes the class template be instantiated, which is not desirable
inside headers. This macro therefore expands to `dllimport` outside of libc++
but nothing inside of it (rather than expanding to `dllexport`); instead, the
explicit instantiations themselves are marked as exported. Note that this
- applies *only* to extern template *classes*. Extern template *functions* obey
+ applies *only* to extern *class* templates. Extern *function* templates obey
regular import/export semantics, and applying `dllexport` directly to the
- extern template declaration is the correct thing to do for them.
+ extern template declaration (i.e. using `_LIBCPP_FUNC_VIS`) is the correct
+ thing to do for them.
**_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS**
Mark the member functions, typeinfo, and vtable of an explicit instantiation
of a class template as being exported by the libc++ library. This attribute
- must be specified on all template class explicit instantiations.
+ must be specified on all class template explicit instantiations.
It is only necessary to mark the explicit instantiation itself (as opposed to
the extern template declaration) as exported on Windows, as discussed above.