diff --git a/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp b/clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp index 6d287eb3642df..6a467910521f5 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>( 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 974a56abd97dd..298243fc3cedd 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 0440ab855ea7b..f8f34794af749 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 07d1e352d3b1b..b28daecf7a2cf 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 f7bd9ff89345b..6e58766275107 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 62786e3ac865e..30ec9c9931509 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 925217431d4d0..1c5043a618fff 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 521c473dd169a..9c103d98af8c5 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() && \ diff --git a/clang/lib/Lex/DependencyDirectivesScanner.cpp b/clang/lib/Lex/DependencyDirectivesScanner.cpp index 980f865cf24c9..0971daa1f3666 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 39108bc838bf2..5f37d9976263a 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 8bbb04024dcce..55af70289ee0d 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 bc4eee73c1c29..59fef9ecbb9c9 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("\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("\n", Out.data()); diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst index a5c6fa22cec06..468226c0c2ddd 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* --------------------------------------------------- ----------------- diff --git a/libcxx/include/__locale_dir/locale_base_api/ibm.h b/libcxx/include/__locale_dir/locale_base_api/ibm.h index 498ea1ecfeda4..c5d7f34186b14 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 b016babbb9485..69d84f640d54e 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/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index cc1fc50ce4123..9e7ea86f2daa8 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -1769,7 +1769,7 @@ def pad_cell(s, length, left_align=True): def get_status_table(): table = [["Macro Name", "Value"]] for std in get_std_dialects(): - table += [["**" + std.replace("c++", "C++ ") + "**", ""]] + table += [["**" + std.replace("c++", "C++") + "**", ""]] for tc in feature_test_macros: if std not in tc["values"].keys(): continue diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst index 20f73c99bff89..abef4f8103140 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*.