[clang] [Clang][Sema] Reject unsupported opencl address space attributes in SYCL and HLSL (PR #152528)

via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 7 08:15:24 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions c,h,cpp -- clang/lib/Sema/AttributeLangSupport.h clang/test/Sema/named_addrspace_lang.c clang/lib/Sema/SemaDeclAttr.cpp clang/lib/Sema/SemaType.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/AttributeLangSupport.h b/clang/lib/Sema/AttributeLangSupport.h
index 601cd6729..32dc32241 100644
--- a/clang/lib/Sema/AttributeLangSupport.h
+++ b/clang/lib/Sema/AttributeLangSupport.h
@@ -1,4 +1,5 @@
-//===- AttributeLangSupport.h ---------------------------------  -*- C++ -*-===//
+//===- AttributeLangSupport.h ---------------------------------  -*- C++
+//-*-===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -7,15 +8,16 @@
 ///
 /// \file
 /// This file contains the declaration of AttributeLangSupport, which is used in
-/// diagnostics to indicate the language in which an attribute is (not) supported.
+/// diagnostics to indicate the language in which an attribute is (not)
+/// supported.
 ///
 //===----------------------------------------------------------------------===//
 
 #ifndef LLVM_CLANG_SEMA_ATTRIBUTE_LANG_SUPPORT_H
 #define LLVM_CLANG_SEMA_ATTRIBUTE_LANG_SUPPORT_H
 
-
-// NOTE: The order should match the order of the %select in err_attribute_not_supported_in_lang
+// NOTE: The order should match the order of the %select in
+// err_attribute_not_supported_in_lang
 //       in DiagnosticSemaKinds.td
 namespace clang::AttributeLangSupport {
 enum LANG {
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 6f4d7a086..bb57ca9eb 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -6583,7 +6583,6 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type,
       Attr.setInvalid();
       return;
     }
-      
 
     if (DiagnoseMultipleAddrSpaceAttributes(S, Type.getAddressSpace(), ASIdx,
                                             Attr.getLoc())) {

``````````

</details>


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


More information about the cfe-commits mailing list