[PATCH] Sema: Require external linkage for dllimport/dllexport attributes

Reid Kleckner rnk at google.com
Wed Mar 26 11:08:25 PDT 2014


LGTM

On Wed, Mar 26, 2014 at 9:28 AM, Nico Rieck <nico.rieck at gmail.com> wrote:

> Both attributes require external linkage. This is not fully compatible
> with MSVC because MSVC allows exporting/importing from anonymous
> namespaces. But until we can mangle this properly this should not be
> allowed.
>

Yeah, I don't think we should support exporting/importing from anonymous
namespaces.  They have external language linkage, but really they aren't
externally visible and can't be imported/exported.  =P

....
+
+#if __has_feature(cxx_auto_type)

Any reason for this #if?  The test only uses c++11 and c++1y.

+__declspec(dllexport) auto InternalAutoTypeGlobal = Internal(); //
expected-error{{'InternalAutoTypeGlobal' must have external linkage when
declared 'dllexport'}}
+__declspec(dllexport) auto ExternalAutoTypeGlobal = External();
+#endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140326/a2927192/attachment.html>


More information about the cfe-commits mailing list