diff options
Diffstat (limited to 'main/clang/D33852-enable-__declspec-selectany-on-linux.patch')
-rw-r--r-- | main/clang/D33852-enable-__declspec-selectany-on-linux.patch | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/main/clang/D33852-enable-__declspec-selectany-on-linux.patch b/main/clang/D33852-enable-__declspec-selectany-on-linux.patch deleted file mode 100644 index 1bba8377f8..0000000000 --- a/main/clang/D33852-enable-__declspec-selectany-on-linux.patch +++ /dev/null @@ -1,64 +0,0 @@ -Enable __declspec(selectany) on linux - -This feature was disabled probably by mistake in rL300562 -This fixes bug https://bugs.llvm.org/show_bug.cgi?id=33285 - -Patch-Source: https://reviews.llvm.org/D33852 -See-Also: https://reviews.llvm.org/rL313278 -See-Also: https://github.com/alpinelinux/aports/pull/2342#issuecomment-341971965 - ---- a/include/clang/Basic/Attr.td -+++ b/include/clang/Basic/Attr.td -@@ -2472,9 +2472,9 @@ - let Documentation = [DLLImportDocs]; - } - --def SelectAny : InheritableAttr, TargetSpecificAttr<TargetWindows> { -+def SelectAny : InheritableAttr { - let Spellings = [Declspec<"selectany">, GCC<"selectany">]; -- let Documentation = [Undocumented]; -+ let Documentation = [SelectAnyDocs]; - } - - def Thread : Attr { ---- a/include/clang/Basic/AttrDocs.td -+++ b/include/clang/Basic/AttrDocs.td -@@ -3192,3 +3192,18 @@ - ensure that this class cannot be subclassed. - }]; - } -+ -+ -+def SelectAnyDocs : Documentation { -+ let Category = DocCatType; -+ let Content = [{ -+This attribute appertains to a global symbol, causing it to have a weak -+definition ( -+`linkonce <https://llvm.org/docs/LangRef.html#linkage-types>`_ -+), allowing the linker to select any definition. -+ -+For more information see -+`gcc documentation <https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Microsoft-Windows-Variable-Attributes.html>`_ -+or `msvc documentation <https://docs.microsoft.com/pl-pl/cpp/cpp/selectany>`_. -+}]; -+} ---- a/test/Sema/attr-selectany.c -+++ b/test/Sema/attr-selectany.c -@@ -1,5 +1,7 @@ - // RUN: %clang_cc1 -triple x86_64-win32 -fdeclspec -verify %s - // RUN: %clang_cc1 -triple x86_64-mingw32 -verify %s -+// RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -fdeclspec %s -+// RUN: %clang_cc1 -triple x86_64-win32-macho -verify -fdeclspec %s - - extern __declspec(selectany) const int x1 = 1; // no warning, const means we need extern in C++ - ---- a/test/SemaCXX/attr-selectany.cpp -+++ b/test/SemaCXX/attr-selectany.cpp -@@ -1,4 +1,7 @@ - // RUN: %clang_cc1 -triple x86_64-win32 -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s -+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s -+// RUN: %clang_cc1 -triple x86_64-win32-macho -fms-compatibility -fms-extensions -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}} |