Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Sema / attr-nonblocking-constraints-ms.cpp
blobdcbcef410987f5874c635d48c5044278add859e0
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}}
10 struct S {
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]] {
22 S a;
23 a.x; // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' function 'S::get_x'}}
24 a.nb;
25 a.nb2;