[PATCH] Support __declspec(selectany) on Mingw

David Majnemer david.majnemer at gmail.com
Wed Mar 26 10:38:27 PDT 2014


> --- a/test/SemaCXX/attr-selectany.cpp
> +++ b/test/SemaCXX/attr-selectany.cpp
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify -std=c++11 %s
> +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
>  // MSVC produces similar diagnostics.
>
>  __declspec(selectany) void foo() { } // expected-error{{'selectany' can
only be applied to data items with external linkage}}
>

Your RUN line will fail for non-mingw hosts.  Also, __declspec(selectany)
still needs to be tested for -fms-extensions.  Something like the following
would be more appropriate:

// RUN: %clang_cc1 -fms-extensions -fsyntax-only -verify -std=c++11 %s
// RUN: %clang_cc1 -triple i386-pc-mingw32 -fsyntax-only -verify -std=c++11
%s

On Tue Mar 25 2014 at 4:28:36 PM, Ivan Garramona <heavenandhell171 at gmail.com>
wrote:

> Trying to build wxWidgets with Clang i've found out that it only support
> selectany under ms-extensions. This patch enable selectany on Mingw as well.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140326/635f6000/attachment.html>


More information about the cfe-commits mailing list