[clang] [Clang] Diagnose conflict between always_inline/noinline attributes (PR #215173)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 08:57:49 PDT 2026


================
@@ -0,0 +1,49 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+
+template <typename T>
+[[clang::noinline]] void foo(T) {}
+
+// Explicit specialization should not inherit noinline
+template <>
+[[clang::always_inline]] void foo<int>(int) {}
----------------
erichkeane wrote:

add for me an explicit specialization of `foo` without an attribute, and a test to make sure there is NO attribute that shows up for it .

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


More information about the cfe-commits mailing list