[clang] [clang] Add support for MSVC force inline attrs (PR #185282)

Trung Nguyen via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 06:22:53 PDT 2026


================
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify -fsyntax-only -std=c++23 %s
----------------
trungnt2910 wrote:

I added a copy for C23 with nearly the same content except the lambda function.

I also added tests on `[[msvc::forceinline]]` on statements and `[[msvc::forceinline_calls]]` on functions, passing unwanted arguments, and a compilation without `-fms-extensions` where these attributes are simply ignored (which preserves the existing behavior).

For the various other cases, since these attributes inherit `[[clang::always_inline]]`, they should have the same behavior. Similarly, `[[gnu::always_inline]]` is not tested for everything.

https://github.com/llvm/llvm-project/pull/185282


More information about the cfe-commits mailing list