-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct C++ standard names #81421
Merged
Merged
Correct C++ standard names #81421
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
llvmbot
added
clang
Clang issues not falling into any other category
clang-tools-extra
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
backend:X86
clang-tidy
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
clang:headers
Headers provided by Clang, e.g. for intrinsics
clang:modules
C++20 modules and Clang Header Modules
clang:dataflow
Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html
labels
Feb 11, 2024
@llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-backend-x86 Author: Danny Mösch (SimplyDanny) ChangesFull diff: https://github.com/llvm/llvm-project/pull/81421.diff 16 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
index 6d287eb3642dfa..6a467910521f5d 100644
--- a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp
@@ -158,7 +158,7 @@ IncludeModernizePPCallbacks::IncludeModernizePPCallbacks(
{"wctype.h", "cwctype"}})) {
CStyledHeaderToCxx.insert(KeyValue);
}
- // Add C++ 11 headers.
+ // Add C++11 headers.
if (LangOpts.CPlusPlus11) {
for (const auto &KeyValue :
std::vector<std::pair<llvm::StringRef, std::string>>(
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/deprecated-headers.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/deprecated-headers.rst
index 974a56abd97dd2..298243fc3cedd2 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize/deprecated-headers.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/deprecated-headers.rst
@@ -4,7 +4,7 @@ modernize-deprecated-headers
============================
Some headers from C library were deprecated in C++ and are no longer welcome in
-C++ codebases. Some have no effect in C++. For more details refer to the C++ 14
+C++ codebases. Some have no effect in C++. For more details refer to the C++14
Standard [depr.c.headers] section.
This check replaces C standard library headers with their C++ alternatives and
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-override.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-override.rst
index 0440ab855ea7bd..f8f34794af7494 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-override.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-override.rst
@@ -10,7 +10,7 @@ removes ``virtual`` from those functions as it is not required.
user that a function was virtual. C++ compilers did not use the presence of
this to signify an overridden function.
-In C++ 11 ``override`` and ``final`` keywords were introduced to allow
+In C++11 ``override`` and ``final`` keywords were introduced to allow
overridden functions to be marked appropriately. Their presence allows
compilers to verify that an overridden function correctly overrides a base
class implementation.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/container-contains.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/container-contains.rst
index 07d1e352d3b1bd..b28daecf7a2cf3 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/container-contains.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/container-contains.rst
@@ -3,7 +3,7 @@
readability-container-contains
==============================
-Finds usages of ``container.count()`` and ``container.find() == container.end()`` which should be replaced by a call to the ``container.contains()`` method introduced in C++ 20.
+Finds usages of ``container.count()`` and ``container.find() == container.end()`` which should be replaced by a call to the ``container.contains()`` method introduced in C++20.
Whether an element is contained inside a container should be checked with ``contains`` instead of ``count``/``find`` because ``contains`` conveys the intent more clearly. Furthermore, for containers which permit multiple entries per key (``multimap``, ``multiset``, ...), ``contains`` is more efficient than ``count`` because ``count`` has to do unnecessary additional work.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/use-anyofallof.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/use-anyofallof.rst
index f7bd9ff89345b6..6e58766275107b 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/readability/use-anyofallof.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/readability/use-anyofallof.rst
@@ -4,7 +4,7 @@ readability-use-anyofallof
==========================
Finds range-based for loops that can be replaced by a call to ``std::any_of`` or
-``std::all_of``. In C++ 20 mode, suggests ``std::ranges::any_of`` or
+``std::all_of``. In C++20 mode, suggests ``std::ranges::any_of`` or
``std::ranges::all_of``.
Example:
diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h
index 62786e3ac865e6..30ec9c99315092 100644
--- a/clang/include/clang/Basic/Module.h
+++ b/clang/include/clang/Basic/Module.h
@@ -118,7 +118,7 @@ class alignas(8) Module {
/// of header files.
ModuleMapModule,
- /// This is a C++ 20 header unit.
+ /// This is a C++20 header unit.
ModuleHeaderUnit,
/// This is a C++20 module interface unit.
@@ -127,10 +127,10 @@ class alignas(8) Module {
/// This is a C++20 module implementation unit.
ModuleImplementationUnit,
- /// This is a C++ 20 module partition interface.
+ /// This is a C++20 module partition interface.
ModulePartitionInterface,
- /// This is a C++ 20 module partition implementation.
+ /// This is a C++20 module partition implementation.
ModulePartitionImplementation,
/// This is the explicit Global Module Fragment of a modular TU.
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp
index 925217431d4d02..1c5043a618fff3 100644
--- a/clang/lib/Basic/Module.cpp
+++ b/clang/lib/Basic/Module.cpp
@@ -376,7 +376,7 @@ Module *Module::findOrInferSubmodule(StringRef Name) {
Module *Module::getGlobalModuleFragment() const {
assert(isNamedModuleUnit() && "We should only query the global module "
- "fragment from the C++ 20 Named modules");
+ "fragment from the C++20 Named modules");
for (auto *SubModule : SubModules)
if (SubModule->isExplicitGlobalModule())
@@ -387,7 +387,7 @@ Module *Module::getGlobalModuleFragment() const {
Module *Module::getPrivateModuleFragment() const {
assert(isNamedModuleUnit() && "We should only query the private module "
- "fragment from the C++ 20 Named modules");
+ "fragment from the C++20 Named modules");
for (auto *SubModule : SubModules)
if (SubModule->isPrivateModule())
diff --git a/clang/lib/Headers/stdatomic.h b/clang/lib/Headers/stdatomic.h
index 521c473dd169ab..9c103d98af8c56 100644
--- a/clang/lib/Headers/stdatomic.h
+++ b/clang/lib/Headers/stdatomic.h
@@ -16,7 +16,7 @@
* Exclude the MSVC path as well as the MSVC header as of the 14.31.30818
* explicitly disallows `stdatomic.h` in the C mode via an `#error`. Fallback
* to the clang resource header until that is fully supported. The
- * `stdatomic.h` header requires C++ 23 or newer.
+ * `stdatomic.h` header requires C++23 or newer.
*/
#if __STDC_HOSTED__ && \
__has_include_next(<stdatomic.h>) && \
diff --git a/clang/lib/Lex/DependencyDirectivesScanner.cpp b/clang/lib/Lex/DependencyDirectivesScanner.cpp
index 980f865cf24c97..0971daa1f36663 100644
--- a/clang/lib/Lex/DependencyDirectivesScanner.cpp
+++ b/clang/lib/Lex/DependencyDirectivesScanner.cpp
@@ -369,7 +369,7 @@ static void skipBlockComment(const char *&First, const char *const End) {
}
}
-/// \returns True if the current single quotation mark character is a C++ 14
+/// \returns True if the current single quotation mark character is a C++14
/// digit separator.
static bool isQuoteCppDigitSeparator(const char *const Start,
const char *const Cur,
diff --git a/clang/test/Analysis/bitwise-shift-common.c b/clang/test/Analysis/bitwise-shift-common.c
index 39108bc838bf27..5f37d9976263ae 100644
--- a/clang/test/Analysis/bitwise-shift-common.c
+++ b/clang/test/Analysis/bitwise-shift-common.c
@@ -154,7 +154,7 @@ int expression_tracked_back(void) {
//===----------------------------------------------------------------------===//
int allow_overflows_and_negative_operands(void) {
- // These are all legal under C++ 20 and many compilers accept them under
+ // These are all legal under C++20 and many compilers accept them under
// earlier standards as well.
int int_min = 1 << 31; // no-warning
int this_overflows = 1027 << 30; // no-warning
diff --git a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
index 8bbb04024dcce6..55af70289ee0de 100644
--- a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
@@ -2093,7 +2093,7 @@ TEST(TransferTest, TemporaryObject) {
TEST(TransferTest, ElidableConstructor) {
// This test is effectively the same as TransferTest.TemporaryObject, but
- // the code is compiled as C++ 14.
+ // the code is compiled as C++14.
std::string Code = R"(
struct A {
int Bar;
diff --git a/clang/unittests/Lex/DependencyDirectivesScannerTest.cpp b/clang/unittests/Lex/DependencyDirectivesScannerTest.cpp
index bc4eee73c1c294..59fef9ecbb9c91 100644
--- a/clang/unittests/Lex/DependencyDirectivesScannerTest.cpp
+++ b/clang/unittests/Lex/DependencyDirectivesScannerTest.cpp
@@ -583,7 +583,7 @@ TEST(MinimizeSourceToDependencyDirectivesTest, UnderscorePragma) {
R"(_Pragma(u"clang module import"))", Out));
EXPECT_STREQ("<TokBeforeEOF>\n", Out.data());
- // FIXME: R"()" strings depend on using C++ 11 language mode
+ // FIXME: R"()" strings depend on using C++11 language mode
ASSERT_FALSE(minimizeSourceToDependencyDirectives(
R"(_Pragma(R"abc(clang module import)abc"))", Out));
EXPECT_STREQ("<TokBeforeEOF>\n", Out.data());
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index a5c6fa22cec06c..9ec629b472e230 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -24,7 +24,7 @@ Status
=================================================== =================
Macro Name Value
=================================================== =================
- **C++ 14**
+ **C++14**
---------------------------------------------------------------------
``__cpp_lib_chrono_udls`` ``201304L``
--------------------------------------------------- -----------------
@@ -66,7 +66,7 @@ Status
--------------------------------------------------- -----------------
``__cpp_lib_tuples_by_type`` ``201304L``
--------------------------------------------------- -----------------
- **C++ 17**
+ **C++17**
---------------------------------------------------------------------
``__cpp_lib_addressof_constexpr`` ``201603L``
--------------------------------------------------- -----------------
@@ -166,7 +166,7 @@ Status
--------------------------------------------------- -----------------
``__cpp_lib_void_t`` ``201411L``
--------------------------------------------------- -----------------
- **C++ 20**
+ **C++20**
---------------------------------------------------------------------
``__cpp_lib_array_constexpr`` ``201811L``
--------------------------------------------------- -----------------
@@ -300,7 +300,7 @@ Status
--------------------------------------------------- -----------------
``__cpp_lib_unwrap_ref`` ``201811L``
--------------------------------------------------- -----------------
- **C++ 23**
+ **C++23**
---------------------------------------------------------------------
``__cpp_lib_adaptor_iterator_pair_constructor`` ``202106L``
--------------------------------------------------- -----------------
@@ -388,7 +388,7 @@ Status
--------------------------------------------------- -----------------
``__cpp_lib_unreachable`` ``202202L``
--------------------------------------------------- -----------------
- **C++ 26**
+ **C++26**
---------------------------------------------------------------------
``__cpp_lib_associative_heterogeneous_insertion`` *unimplemented*
--------------------------------------------------- -----------------
@@ -452,4 +452,3 @@ Status
--------------------------------------------------- -----------------
``__cpp_lib_within_lifetime`` *unimplemented*
=================================================== =================
-
diff --git a/libcxx/include/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__locale_dir/locale_base_api/ibm.h
index 498ea1ecfeda40..c5d7f34186b14e 100644
--- a/libcxx/include/__locale_dir/locale_base_api/ibm.h
+++ b/libcxx/include/__locale_dir/locale_base_api/ibm.h
@@ -100,7 +100,7 @@ inline _LIBCPP_HIDE_FROM_ABI int vasprintf(char** strp, const char* fmt, va_list
}
va_list ap_copy;
- // va_copy may not be provided by the C library in C++ 03 mode.
+ // va_copy may not be provided by the C library in C++03 mode.
#if defined(_LIBCPP_CXX03_LANG) && __has_builtin(__builtin_va_copy)
__builtin_va_copy(ap_copy, ap);
#else
diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
index b016babbb94852..69d84f640d54e6 100644
--- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
+++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
@@ -17,7 +17,7 @@
//
// If the library was built in c++23 mode, this test would succeed.
//
-// Older CMake passed -std:c++latest to set C++ 20 mode on clang-cl, which
+// Older CMake passed -std:c++latest to set C++20 mode on clang-cl, which
// hid this issue. With newer CMake versions, it passes -std:c++20 which
// makes this fail.
//
diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst
index 20f73c99bff89d..abef4f8103140f 100644
--- a/llvm/docs/CMake.rst
+++ b/llvm/docs/CMake.rst
@@ -277,7 +277,7 @@ manual, or execute ``cmake --help-variable VARIABLE_NAME``.
**CMAKE_CXX_STANDARD**:STRING
Sets the C++ standard to conform to when building LLVM. Possible values are
- 17 and 20. LLVM Requires C++ 17 or higher. This defaults to 17.
+ 17 and 20. LLVM Requires C++17 or higher. This defaults to 17.
**CMAKE_INSTALL_BINDIR**:PATH
The path to install executables, relative to the *CMAKE_INSTALL_PREFIX*.
|
SimplyDanny
force-pushed
the
c++-standard-style
branch
from
February 11, 2024 16:37
836e742
to
d2b0ecd
Compare
EugeneZelenko
approved these changes
Feb 11, 2024
SimplyDanny
force-pushed
the
c++-standard-style
branch
from
February 11, 2024 17:01
d2b0ecd
to
270d4db
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend:X86
clang:dataflow
Clang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
clang:headers
Headers provided by Clang, e.g. for intrinsics
clang:modules
C++20 modules and Clang Header Modules
clang
Clang issues not falling into any other category
clang-tidy
clang-tools-extra
libc++
libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.