You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// expected-note@+1{{conflicting attribute is here}}
7
+
// expected-note@+1 2 {{conflicting attribute is here}}
8
8
[[gnu::flatten]] voidflatten_fn(void) { }
9
9
[[gnu::noinline]] voidnoinline_fn(void) { }
10
10
@@ -25,7 +25,21 @@ void foo() {
25
25
__attribute__((noinline)) bar(); // expected-warning {{attribute is ignored on this statement as it only applies to functions; use '[[clang::noinline]]' on statements}}
26
26
}
27
27
28
+
voidms_noi_check() {
29
+
[[msvc::noinline]] bar();
30
+
[[msvc::noinline(0)]] bar(); // expected-error {{'noinline' attribute takes no arguments}}
31
+
int x;
32
+
[[msvc::noinline]] x = 0; // expected-warning {{'noinline' attribute is ignored because there exists no call expression inside the statement}}
33
+
[[msvc::noinline]] { asm("nop"); } // expected-warning {{'noinline' attribute is ignored because there exists no call expression inside the statement}}
34
+
[[msvc::noinline]] label: x = 1; // expected-warning {{'noinline' attribute only applies to functions and statements}}
35
+
36
+
[[msvc::noinline]] always_inline_fn(); // expected-warning {{statement attribute 'noinline' has higher precedence than function attribute 'always_inline'}}
37
+
[[msvc::noinline]] flatten_fn(); // expected-warning {{statement attribute 'noinline' has higher precedence than function attribute 'flatten'}}
38
+
[[msvc::noinline]] noinline_fn();
39
+
}
40
+
28
41
[[clang::noinline]] staticint i = bar(); // expected-warning {{'noinline' attribute only applies to functions and statements}}
42
+
[[msvc::noinline]] staticint j = bar(); // expected-warning {{'noinline' attribute only applies to functions and statements}}
0 commit comments