1 // RUN: %clang_cc1 -std=c++14 %s -triple x86_64-windows-msvc -fdeclspec -verify
2 // RUN: %clang_cc1 -std=c++17 %s -triple x86_64-windows-msvc -fdeclspec -verify
3 // RUN: %clang_cc1 -std=c++14 %s -triple x86_64-scei-ps4 -fdeclspec -verify
5 // MSVC emits this error too.
6 const int __declspec(selectany
) test1
= 0; // expected-error {{'selectany' can only be applied to data items with external linkage}}
8 extern const int test2
;
9 const int test2
= 42; // expected-note {{previous definition is here}}
10 extern __declspec(selectany
) const int test2
; // expected-warning {{attribute declaration must precede definition}}
12 extern const int test3
;
13 const int __declspec(selectany
) test3
= 42; // Standard usage.
16 static constexpr int sdm
= 0;
18 __declspec(selectany
) constexpr int Test4::sdm
; // no warning