<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/79910>79910</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] c++ modules: tying `export` keyword (and public/protected class visibility) to adding `__declspec(dllexport)`/`__attribute__((visibility("default")))`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          NekkoDroid
      </td>
    </tr>
</table>

<pre>
    When working with C++ modules and shared libraries I was looking for a way to simplify exporting symbols from a shared library. Now that modules have `export` as a keyword it would make sense to tie SO visibility to this in some way.

The idea is, to have a flag to tell the compiler, to hide all symbols by default where not done by default (implicit `-fvisibility=hidden` on supported platforms) and when a symbol is marked `export` (and public/protected for classes) it would implicitly add `__declspec(dllexport)`, `__attribute__ ((visibility("default")))` or whatever other necessary step attribute to make the symbol visible to other binaries.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8Fu6zYQ_BrqsoghUbFkHnR4eYaBXl4PLdBjQIkrc2tKFLhUVP19QdrJSwq0QAHDgrC7MzszWs1M1xmxE8cXcTwXeo3Wh-4H3m7-HDyZovdm7_6wOMPmw43mK2wULXwX8kXIF5i8WR0y6NkAWx3QgKM-6EDI8AtsmsF5n-dGH0DDpneIHpimxdG4A_61-BBTnfep945hDH4C_RVtP8APv0G0On5QWv2GIJryjiCaEjSDhhvumw8GKMLmV2dg0jcExpkxEUdC-O1XeCOmnhzFvE20xEAzsJ8wbXgQ5VmU3-7_v1sEMqiBWMjvqT0zaxidvuZpdA6iRRj8tJDD8N5GBkE796Gs38HgqFcXYbMYEGYfwfgZP1eEPGVvBopJ3dP4c1VRny0Zg3MS62fgdUnS0cDidBx9mFhIlbPYUmL6wQzEMOlwQ_PVLyFPqXdZe0eDkJcl-IhDwktZDU4zY0b88PJ9M7eDNhnt9dXg4HjBQciTce6BLpVoyuRDbtExBurXiK-viVTI0ydR6V0-1Asp0-j9l0QG2KyO-IYBfLQYYMYBmXXYgSMu8IGcDM9JpyAesjOJy6X7cE9z_jIPhelqo2qlC-yqtmyOjVKNKmzXn1psB9mPZaPUWJmxrHBQbY2tUijLqqBOlvK5rKSSdSWf1aGs2rppWlUb0w5104jnEidN7uDc23Tw4VoQ84pdq1RVFk736Difm5SD0_M1ST6ei9Cl_qd-vbJ4Lh1x5J8IkaLLN3qfOJ5h-Hp_ov4GcU9X9CXg91v496BzyPA5DZXs0sY8wP4738s_4_0_6RZrcJ2NcUnrJyx5uVK0a38Y_CTkJcl_PJ6W4P_EIQp5yW6ykJds6N8BAAD___6_l7w">