[clang] Add Variadic 'dropAttrs' (PR #78476)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 09:09:42 PST 2024


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 2cd013a7869a341a6536324c34f0c4e68bf01a38 6790e56b001a29e8bba012514eb3b12cd486d505 -- clang/include/clang/AST/DeclBase.h clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/lib/Sema/SemaTemplate.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h
index 933249b4a1..d957ea24f6 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -548,8 +548,7 @@ public:
     return hasAttrs() ? getAttrs().end() : nullptr;
   }
 
-  template<typename ...Ts>
-  void dropAttrs() {
+  template <typename... Ts> void dropAttrs() {
     if (!HasAttrs) return;
 
     AttrVec &Vec = getAttrs();
@@ -559,10 +558,7 @@ public:
       HasAttrs = false;
   }
 
-  template <typename T>
-  void dropAttr() {
-    dropAttrs<T>();
-  }
+  template <typename T> void dropAttr() { dropAttrs<T>(); }
 
   template <typename T>
   llvm::iterator_range<specific_attr_iterator<T>> specific_attrs() const {
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index b5be596b7d..0655d36335 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -9230,7 +9230,7 @@ void Sema::CheckConceptRedefinition(ConceptDecl *NewDecl,
 static void StripImplicitInstantiation(NamedDecl *D, bool MinGW) {
   if (MinGW || (isa<FunctionDecl>(D) &&
                 cast<FunctionDecl>(D)->isFunctionTemplateSpecialization()))
-    D->dropAttrs< DLLImportAttr, DLLExportAttr>();
+    D->dropAttrs<DLLImportAttr, DLLExportAttr>();
 
   if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
     FD->setInlineSpecified(false);

``````````

</details>


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


More information about the cfe-commits mailing list