summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/include/clang/Basic/Attr.td5
-rw-r--r--clang/test/Sema/attr-selectany.c3
-rw-r--r--clang/test/SemaCXX/attr-selectany.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index bf62408db2c..69dbdba3ec1 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -2351,9 +2351,8 @@ def DLLImport : InheritableAttr, TargetSpecificAttr<TargetWindows> {
let Documentation = [DLLImportDocs];
}
-def SelectAny : InheritableAttr {
- let Spellings = [Declspec<"selectany">];
- let LangOpts = [MicrosoftExt];
+def SelectAny : InheritableAttr, TargetSpecificAttr<TargetWindows> {
+ let Spellings = [Declspec<"selectany">, GCC<"selectany">];
let Documentation = [Undocumented];
}
diff --git a/clang/test/Sema/attr-selectany.c b/clang/test/Sema/attr-selectany.c
index 01cca7d7cfa..9fa2fcade53 100644
--- a/clang/test/Sema/attr-selectany.c
+++ b/clang/test/Sema/attr-selectany.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fms-compatibility -fms-extensions -verify %s
+// RUN: %clang_cc1 -triple x86_64-win32 -fdeclspec -verify %s
+// RUN: %clang_cc1 -triple x86_64-mingw32 -verify %s
extern __declspec(selectany) const int x1 = 1; // no warning, const means we need extern in C++
diff --git a/clang/test/SemaCXX/attr-selectany.cpp b/clang/test/SemaCXX/attr-selectany.cpp
index 9dc14b3c381..62fca09ab36 100644
--- a/clang/test/SemaCXX/attr-selectany.cpp
+++ b/clang/test/SemaCXX/attr-selectany.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-compatibility -fms-extensions -fsyntax-only -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple x86_64-win32 -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}}
OpenPOWER on IntegriCloud