[llvm-branch-commits] [libcxx] 0e823b0 - [libc++] Update libcpp-uglify-attributes to diagnose all attributes in C++03

Nikolas Klauser via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 4 11:02:37 PST 2023


Author: Nikolas Klauser
Date: 2023-12-02T14:04:01+01:00
New Revision: 0e823b02ba8a0f61ddd14bb128cf8e12fe14602a

URL: https://github.com/llvm/llvm-project/commit/0e823b02ba8a0f61ddd14bb128cf8e12fe14602a
DIFF: https://github.com/llvm/llvm-project/commit/0e823b02ba8a0f61ddd14bb128cf8e12fe14602a.diff

LOG: [libc++] Update libcpp-uglify-attributes to diagnose all attributes in C++03

Added: 
    

Modified: 
    libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp b/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp
index 5252087d55ee9..7812b236f613c 100644
--- a/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp
+++ b/libcxx/test/tools/clang_tidy_checks/uglify_attributes.cpp
@@ -44,7 +44,12 @@ bool CPlusPlus23(const T& lang_opts)
 }
 
 std::vector<const char*> get_standard_attributes(const clang::LangOptions& lang_opts) {
-  std::vector<const char*> attributes = {"noreturn", "carries_dependency"};
+  std::vector<const char*> attributes;
+
+  if (lang_opts.CPlusPlus11) {
+    attributes.emplace_back("noreturn");
+    attributes.emplace_back("carries_dependency");
+  }
 
   if (lang_opts.CPlusPlus14)
     attributes.emplace_back("deprecated");


        


More information about the llvm-branch-commits mailing list