[clang] [Sema] Add original GH192264 reproducer as a section-conflict regression test (PR #202276)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 04:48:42 PDT 2026


https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/202276

>From dd5a66b227d1b6abcfea9bfaef54eb091afa5d4e Mon Sep 17 00:00:00 2001
From: Li Jinpei <jinpli at amd.com>
Date: Mon, 8 Jun 2026 14:46:14 +0800
Subject: [PATCH 1/2] [Sema] Add original GH192264 reproducer as a
 section-conflict regression test

---
 clang/test/SemaCXX/attr-section.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/clang/test/SemaCXX/attr-section.cpp b/clang/test/SemaCXX/attr-section.cpp
index 95d4fc53ebe6c..f8ac9131f06ff 100644
--- a/clang/test/SemaCXX/attr-section.cpp
+++ b/clang/test/SemaCXX/attr-section.cpp
@@ -84,3 +84,11 @@ auto lambda = [](int val) __attribute__((section("lambda_op_pragma"))) { return
 #pragma clang section bss="lambda_op_pragma" // expected-error {{this causes a section type conflict with 'operator()'}}
 #pragma clang section bss=""
 } // namespace lambda_call_operator_pragma
+
+// original: https://github.com/llvm/llvm-project/issues/192264
+namespace GH192264_original {
+struct S {};
+using F = decltype([](auto val) // expected-note {{declared here}}
+__attribute__((section("gh192264"))) const S s{}; // expected-error {{expected body of lambda expression}}
+__attribute__((section("gh192264"))) int i{}; // expected-error {{'i' causes a section type conflict with 'operator()'}}
+} // namespace GH192264_original

>From b99c973a3bce447ae8085a0c53bba9c5591b9a29 Mon Sep 17 00:00:00 2001
From: Aaron Ballman <aaron at aaronballman.com>
Date: Tue, 9 Jun 2026 07:48:34 -0400
Subject: [PATCH 2/2] Update clang/test/SemaCXX/attr-section.cpp

---
 clang/test/SemaCXX/attr-section.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang/test/SemaCXX/attr-section.cpp b/clang/test/SemaCXX/attr-section.cpp
index f8ac9131f06ff..fb471b3f8e229 100644
--- a/clang/test/SemaCXX/attr-section.cpp
+++ b/clang/test/SemaCXX/attr-section.cpp
@@ -85,7 +85,6 @@ auto lambda = [](int val) __attribute__((section("lambda_op_pragma"))) { return
 #pragma clang section bss=""
 } // namespace lambda_call_operator_pragma
 
-// original: https://github.com/llvm/llvm-project/issues/192264
 namespace GH192264_original {
 struct S {};
 using F = decltype([](auto val) // expected-note {{declared here}}



More information about the cfe-commits mailing list