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

When applied on a function declaration, both will always attempt to inline 
calls to the function.

When applied to a non-declaration statement, the behavior of 
`[[msvc::forceinline]]` is unspecified (but MSVC accepts it without warnings), 
while `[[clang::always_inline]]` tells the compiler to also inline the function 
calls appearing in the statement.

When applied to a non-function declaration, the behavior of the MSVC version is 
once again, unspecified, while Clang says the attribute will not work. In 
reality, both compilers emit similar errors (attempting to apply a function 
attribute to a non-function or something like that). 

You can check the [MSVC 
documentation](https://learn.microsoft.com/en-us/cpp/cpp/attributes?view=msvc-170#msvcforceinline)
 and [Clang 
documentation](https://clang.llvm.org/docs/AttributeReference.html#always-inline-force-inline)
 for more details. 

https://github.com/llvm/llvm-project/pull/185282
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to