1 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -fsyntax-only -fblocks -fcxx-exceptions -fms-extensions -verify -Wfunction-effects %s
3 #pragma clang diagnostic ignored "-Wperf-constraint-implies-noexcept"
5 // These need '-fms-extensions' (and maybe '-fdeclspec')
6 void f1() [[clang::nonblocking
]] {
7 __try
{} __except (1) {} // expected-warning {{function with 'nonblocking' attribute must not throw or catch exceptions}}
11 int get_x(); // expected-note {{declaration cannot be inferred 'nonblocking' because it has no definition in this translation unit}}
12 __declspec(property(get
= get_x
)) int x
;
14 int get_nb() { return 42; }
15 __declspec(property(get
= get_nb
)) int nb
;
17 int get_nb2() [[clang::nonblocking
]];
18 __declspec(property(get
= get_nb2
)) int nb2
;
21 void f2() [[clang::nonblocking
]] {
23 a
.x
; // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' function 'S::get_x'}}