https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/118031
>From 9451a1e4f5db18d579b5f7eb206482708c9adc70 Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Tue, 26 Nov 2024 22:28:16 +0100 Subject: [PATCH 01/11] Add support for '-Warray-compare' compiler flag --- clang/include/clang/Basic/DiagnosticGroups.td | 1 + clang/include/clang/Basic/DiagnosticSemaKinds.td | 5 +++++ clang/lib/Sema/SemaExpr.cpp | 14 ++++++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index df9bf94b5d0398..0b57d41c617963 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -699,6 +699,7 @@ def GNUStatementExpressionFromMacroExpansion : def GNUStatementExpression : DiagGroup<"gnu-statement-expression", [GNUStatementExpressionFromMacroExpansion]>; def StringConcatation : DiagGroup<"string-concatenation">; +def ArrayCompare : DiagGroup<"array-compare">; def StringCompare : DiagGroup<"string-compare">; def StringPlusInt : DiagGroup<"string-plus-int">; def StringPlusChar : DiagGroup<"string-plus-char">; diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 834e588c18e376..a96fddcc797d36 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10264,6 +10264,11 @@ def warn_depr_array_comparison : Warning< "to compare array addresses, use unary '+' to decay operands to pointers">, InGroup<DeprecatedArrayCompare>; +def warn_array_comparison : Warning< + "comparison between two arrays; " + "to compare array addresses, use unary '+' to decay operands to pointers">, + InGroup<ArrayCompare>; + def warn_stringcompare : Warning< "result of comparison against %select{a string literal|@encode}0 is " "unspecified (use an explicit string comparison function instead)">, diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index c9d7444d5865a5..d51aca4fbaf492 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11857,11 +11857,17 @@ static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc, // C++2a [depr.array.comp]: // Equality and relational comparisons ([expr.eq], [expr.rel]) between two // operands of array type are deprecated. - if (S.getLangOpts().CPlusPlus20 && LHSStripped->getType()->isArrayType() && + if (LHSStripped->getType()->isArrayType() && RHSStripped->getType()->isArrayType()) { - S.Diag(Loc, diag::warn_depr_array_comparison) - << LHS->getSourceRange() << RHS->getSourceRange() - << LHSStripped->getType() << RHSStripped->getType(); + auto IsDeprArrayComparionIgnored = + S.getDiagnostics().isIgnored(diag::warn_depr_array_comparison, Loc); + auto IsDeprArrayComparion = + !S.getLangOpts().CPlusPlus20 || IsDeprArrayComparionIgnored; + + auto DiagID = IsDeprArrayComparion ? diag::warn_array_comparison + : diag::warn_depr_array_comparison; + S.Diag(Loc, DiagID) << LHS->getSourceRange() << RHS->getSourceRange() + << LHSStripped->getType() << RHSStripped->getType(); // Carry on to produce the tautological comparison warning, if this // expression is potentially-evaluated, we can resolve the array to a // non-weak declaration, and so on. >From 6de4cba4dc9edae545efe85d2435d1f4430968af Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Wed, 27 Nov 2024 21:17:21 +0100 Subject: [PATCH 02/11] Add lit test for array-comparison --- clang/test/SemaCXX/deprecated.cpp | 12 +++++++----- clang/test/SemaCXX/warn-self-comparisons.cpp | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/clang/test/SemaCXX/deprecated.cpp b/clang/test/SemaCXX/deprecated.cpp index 667f4d7d3edb03..03f3b2b8ff06be 100644 --- a/clang/test/SemaCXX/deprecated.cpp +++ b/clang/test/SemaCXX/deprecated.cpp @@ -246,17 +246,19 @@ namespace ArithConv { namespace ArrayComp { int arr1[3], arr2[4]; - bool b1 = arr1 == arr2; // expected-warning {{array comparison always evaluates to false}} cxx20-warning {{comparison between two arrays is deprecated}} - bool b2 = arr1 < arr2; // expected-warning {{array comparison always evaluates to a constant}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b1 = arr1 == arr2; // not-cxx20-warning {{comparison between two arrays}} cxx20-warning {{comparison between two arrays is deprecated}} + // expected-warning@-1 {{array comparison always evaluates to false}} + bool b2 = arr1 < arr2; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + // expected-warning@-1 {{array comparison always evaluates to a constant}} __attribute__((weak)) int arr3[3]; - bool b3 = arr1 == arr3; // cxx20-warning {{comparison between two arrays is deprecated}} - bool b4 = arr1 < arr3; // cxx20-warning {{comparison between two arrays is deprecated}} + bool b3 = arr1 == arr3; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b4 = arr1 < arr3; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} #if __cplusplus > 201703L bool b5 = arr1 <=> arr2; // cxx20-error {{invalid operands}} #endif int (&f())[3]; - bool b6 = arr1 == f(); // cxx20-warning {{comparison between two arrays is deprecated}} + bool b6 = arr1 == f(); // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} bool b7 = arr1 == +f(); } diff --git a/clang/test/SemaCXX/warn-self-comparisons.cpp b/clang/test/SemaCXX/warn-self-comparisons.cpp index 2e8d130bcd5a0a..daf546d5858074 100644 --- a/clang/test/SemaCXX/warn-self-comparisons.cpp +++ b/clang/test/SemaCXX/warn-self-comparisons.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -// expected-no-diagnostics +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s -verify=expected,not-cxx20 +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wdeprecated -verify %s -verify=expected,cxx20 void f(int (&array1)[2], int (&array2)[2]) { - if (array1 == array2) { } // no warning + if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} } >From fe4fab80606ecc7cdbf5eb6bfa1465b96fd867e5 Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Wed, 27 Nov 2024 22:43:29 +0100 Subject: [PATCH 03/11] Add test file to handle warn array comparion cases --- clang/test/SemaCXX/warn-array-comparion.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 clang/test/SemaCXX/warn-array-comparion.cpp diff --git a/clang/test/SemaCXX/warn-array-comparion.cpp b/clang/test/SemaCXX/warn-array-comparion.cpp new file mode 100644 index 00000000000000..bda6b6969400f1 --- /dev/null +++ b/clang/test/SemaCXX/warn-array-comparion.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s -verify=expected,not-cxx20 +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wno-deprecated-array-compare -verify %s -verify=expected,not-cxx20 +// RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wdeprecated -verify %s -verify=expected,cxx20 + +typedef struct { + char str[16]; + int id[16]; +} Object; + +bool object_equal(const Object &obj1, const Object &obj2) { + if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + return false; + if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + return false; + return true; +} + + +void foo(int (&array1)[2], int (&array2)[2]) { + if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} +} >From bece93792867375d0112d5686b00be21110f4da1 Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Wed, 27 Nov 2024 22:45:48 +0100 Subject: [PATCH 04/11] Update comment to add warning case in C++1a versions --- clang/lib/Sema/SemaExpr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d51aca4fbaf492..e30587459b8aff 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11854,6 +11854,9 @@ static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc, AlwaysEqual, // std::strong_ordering::equal from operator<=> }; + // C++1a [array.comp]: + // Equality and relational comparisons ([expr.eq], [expr.rel]) between two + // operands of array type. // C++2a [depr.array.comp]: // Equality and relational comparisons ([expr.eq], [expr.rel]) between two // operands of array type are deprecated. >From ef7485c9c279205ef3b23bfd7e326b9050ff88ca Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Thu, 28 Nov 2024 21:36:02 +0100 Subject: [PATCH 05/11] Update Test file to expect warning in C++ mode --- clang/lib/Sema/SemaExpr.cpp | 2 +- clang/test/Sema/warn-stringcompare.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index e30587459b8aff..4f66cff82416c8 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11860,7 +11860,7 @@ static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc, // C++2a [depr.array.comp]: // Equality and relational comparisons ([expr.eq], [expr.rel]) between two // operands of array type are deprecated. - if (LHSStripped->getType()->isArrayType() && + if (S.getLangOpts().CPlusPlus && LHSStripped->getType()->isArrayType() && RHSStripped->getType()->isArrayType()) { auto IsDeprArrayComparionIgnored = S.getDiagnostics().isIgnored(diag::warn_depr_array_comparison, Loc); diff --git a/clang/test/Sema/warn-stringcompare.c b/clang/test/Sema/warn-stringcompare.c index 77876ad6abd6e7..78145cf42578a4 100644 --- a/clang/test/Sema/warn-stringcompare.c +++ b/clang/test/Sema/warn-stringcompare.c @@ -1,5 +1,5 @@ // RUN: %clang_cc1 -x c -fsyntax-only -verify %s -// RUN: %clang_cc1 -x c++ -fsyntax-only -verify %s +// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=expected,cxx %s #define DELIM "/" #define DOT "." @@ -15,15 +15,15 @@ void test(const char *d) { if (NULL == "/") return; if ("/" != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} - return; + return; // cxx-warning@-1 {{comparison between two arrays}} if (DELIM == "/") // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} - return; + return; // cxx-warning@-1 {{comparison between two arrays}} if (DELIM != NULL) return; if (NULL == DELIM) return; if (DOT != DELIM) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} - return; + return; // cxx-warning@-1 {{comparison between two arrays}} if (DELIM == DOT) // expected-warning {{result of comparison against a string literal is unspecified (use an explicit string comparison function instead)}} - return; + return; // cxx-warning@-1 {{comparison between two arrays}} } >From b2034a42f8a50d653c96c7767af3ee520cac8d8e Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Thu, 28 Nov 2024 21:51:26 +0100 Subject: [PATCH 06/11] Update Cpp array compare warnings --- clang/test/Analysis/reference.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/test/Analysis/reference.cpp b/clang/test/Analysis/reference.cpp index b893aec2a7d542..91ba3cd23249a3 100644 --- a/clang/test/Analysis/reference.cpp +++ b/clang/test/Analysis/reference.cpp @@ -89,8 +89,8 @@ namespace PR13440 { S s = { a }; S2 s2 = { a }; - if (s.x != a) return; - if (s2.x != a) return; + if (s.x != a) return; // expected-warning {{comparison between two arrays}} + if (s2.x != a) return; // expected-warning {{comparison between two arrays}} a[0] = 42; clang_analyzer_eval(s.x[0] == 42); // expected-warning{{TRUE}} >From 49730e1757c969aae846da824374805a88a5900d Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Mon, 2 Dec 2024 18:29:02 +0100 Subject: [PATCH 07/11] Inline diagnostic group | Remove unneeded variable --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 +-- clang/lib/Sema/SemaExpr.cpp | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index a96fddcc797d36..6a37b3580ceef0 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10266,8 +10266,7 @@ def warn_depr_array_comparison : Warning< def warn_array_comparison : Warning< "comparison between two arrays; " - "to compare array addresses, use unary '+' to decay operands to pointers">, - InGroup<ArrayCompare>; + "to compare array addresses, use unary '+' to decay operands to pointers">; def warn_stringcompare : Warning< "result of comparison against %select{a string literal|@encode}0 is " diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 4f66cff82416c8..005f7524955f3e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -11864,11 +11864,9 @@ static void diagnoseTautologicalComparison(Sema &S, SourceLocation Loc, RHSStripped->getType()->isArrayType()) { auto IsDeprArrayComparionIgnored = S.getDiagnostics().isIgnored(diag::warn_depr_array_comparison, Loc); - auto IsDeprArrayComparion = - !S.getLangOpts().CPlusPlus20 || IsDeprArrayComparionIgnored; - - auto DiagID = IsDeprArrayComparion ? diag::warn_array_comparison - : diag::warn_depr_array_comparison; + auto DiagID = !S.getLangOpts().CPlusPlus20 || IsDeprArrayComparionIgnored + ? diag::warn_array_comparison + : diag::warn_depr_array_comparison; S.Diag(Loc, DiagID) << LHS->getSourceRange() << RHS->getSourceRange() << LHSStripped->getType() << RHSStripped->getType(); // Carry on to produce the tautological comparison warning, if this >From 80ecba0aa2f52074bb334c66f480619687fa3fd8 Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Mon, 2 Dec 2024 18:52:36 +0100 Subject: [PATCH 08/11] Update Diagnostic message for array comparion --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 +- clang/test/SemaCXX/deprecated.cpp | 10 +++++----- clang/test/SemaCXX/warn-array-comparion.cpp | 6 +++--- clang/test/SemaCXX/warn-self-comparisons.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 6a37b3580ceef0..1758a8d0ffb2bd 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10265,7 +10265,7 @@ def warn_depr_array_comparison : Warning< InGroup<DeprecatedArrayCompare>; def warn_array_comparison : Warning< - "comparison between two arrays; " + "comparison between two arrays compare their addresses and will be deprecated in c++20; " "to compare array addresses, use unary '+' to decay operands to pointers">; def warn_stringcompare : Warning< diff --git a/clang/test/SemaCXX/deprecated.cpp b/clang/test/SemaCXX/deprecated.cpp index 03f3b2b8ff06be..4282239af81b4c 100644 --- a/clang/test/SemaCXX/deprecated.cpp +++ b/clang/test/SemaCXX/deprecated.cpp @@ -246,19 +246,19 @@ namespace ArithConv { namespace ArrayComp { int arr1[3], arr2[4]; - bool b1 = arr1 == arr2; // not-cxx20-warning {{comparison between two arrays}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b1 = arr1 == arr2; // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} // expected-warning@-1 {{array comparison always evaluates to false}} - bool b2 = arr1 < arr2; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b2 = arr1 < arr2; // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} // expected-warning@-1 {{array comparison always evaluates to a constant}} __attribute__((weak)) int arr3[3]; - bool b3 = arr1 == arr3; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} - bool b4 = arr1 < arr3; // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b3 = arr1 == arr3; // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b4 = arr1 < arr3; // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} #if __cplusplus > 201703L bool b5 = arr1 <=> arr2; // cxx20-error {{invalid operands}} #endif int (&f())[3]; - bool b6 = arr1 == f(); // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + bool b6 = arr1 == f(); // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} bool b7 = arr1 == +f(); } diff --git a/clang/test/SemaCXX/warn-array-comparion.cpp b/clang/test/SemaCXX/warn-array-comparion.cpp index bda6b6969400f1..a6eaaab22fc16d 100644 --- a/clang/test/SemaCXX/warn-array-comparion.cpp +++ b/clang/test/SemaCXX/warn-array-comparion.cpp @@ -8,14 +8,14 @@ typedef struct { } Object; bool object_equal(const Object &obj1, const Object &obj2) { - if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + if (obj1.str != obj2.str) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} return false; - if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + if (obj1.id != obj2.id) // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} return false; return true; } void foo(int (&array1)[2], int (&array2)[2]) { - if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} } diff --git a/clang/test/SemaCXX/warn-self-comparisons.cpp b/clang/test/SemaCXX/warn-self-comparisons.cpp index daf546d5858074..3847c2d918bf61 100644 --- a/clang/test/SemaCXX/warn-self-comparisons.cpp +++ b/clang/test/SemaCXX/warn-self-comparisons.cpp @@ -2,5 +2,5 @@ // RUN: %clang_cc1 -std=c++20 -fsyntax-only -Wdeprecated -verify %s -verify=expected,cxx20 void f(int (&array1)[2], int (&array2)[2]) { - if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays;}} cxx20-warning {{comparison between two arrays is deprecated}} + if (array1 == array2) { } // not-cxx20-warning {{comparison between two arrays compare their addresses}} cxx20-warning {{comparison between two arrays is deprecated}} } >From 55e348921cc8dae99e2aabfb3712ea737163f74f Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Mon, 2 Dec 2024 19:34:36 +0100 Subject: [PATCH 09/11] Inline diagnostic group --- clang/include/clang/Basic/DiagnosticSemaKinds.td | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index e0236082867eab..72d4bed84e2ab8 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -10271,7 +10271,8 @@ def warn_depr_array_comparison : Warning< def warn_array_comparison : Warning< "comparison between two arrays compare their addresses and will be deprecated in c++20; " - "to compare array addresses, use unary '+' to decay operands to pointers">; + "to compare array addresses, use unary '+' to decay operands to pointers">, + InGroup<DiagGroup<"array-compare">>; def warn_stringcompare : Warning< "result of comparison against %select{a string literal|@encode}0 is " >From cc67aa8782e6531fed57bc75293a5917523dd0ed Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Mon, 2 Dec 2024 19:35:45 +0100 Subject: [PATCH 10/11] Update the release note --- clang/docs/ReleaseNotes.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 0bb2eb820cd726..ee72b58ed9df8c 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -415,6 +415,9 @@ New Compiler Flags existing ``-fno-c++-static-destructors`` flag) skips all static destructors registration. +- The ``-Warray-compare`` warning has been added to warn about array comparison + on versions older than C++20 + Deprecated Compiler Flags ------------------------- >From d3ff02d8871d4b5db76a4c282a04641cd3c0a09b Mon Sep 17 00:00:00 2001 From: AmrDeveloper <am...@programmer.net> Date: Mon, 2 Dec 2024 19:42:42 +0100 Subject: [PATCH 11/11] Fix releasenote indentation --- clang/docs/ReleaseNotes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index ee72b58ed9df8c..bb59c1931f6775 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -416,7 +416,7 @@ New Compiler Flags destructors registration. - The ``-Warray-compare`` warning has been added to warn about array comparison - on versions older than C++20 + on versions older than C++20. Deprecated Compiler Flags ------------------------- _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits