[clang-tools-extra] [clang-tidy] fix false-negative for macros in `readability-math-missing-parentheses` (PR #90279)

2024-04-26 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy approved this pull request. LGTM. Thank you for CCing me. https://github.com/llvm/llvm-project/pull/90279 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-26 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Humble ping! https://github.com/llvm/llvm-project/pull/88489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-23 Thread Bhuminjay Soni via cfe-commits
11happy wrote: hello @5chmidti I am sorry for my delayed response quite busy with my academic work last week, I have added this change ``` if (EndLoc.isInvalid()) return; ``` this works fine for those macros. Thank you https://github.com/llvm/llvm-project/pull/84481

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-23 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/14] add clang-tidy check readability-math-missing-parentheses

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -Wno-pointer-integer-compare -Wpointer-integer-ordered-compare -fsyntax-only -verify=pointer-integer-ordered %s +// RUN: %clang_cc1 -Wpointer-integer-compare -Wno-pointer-integer-ordered-compare -fsyntax-only -verify=pointer-integer %s +

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
@@ -245,6 +245,12 @@ Modified Compiler Flags f3 *c = (f3 *)x; } +- Added a new diagnostic flag ``-Wpointer-integer-ordered-compare`` which is + grouped under ``-Wpointer-integer-compare`` and moved previously + ungrouped diagnostics

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
@@ -714,10 +714,11 @@ def HeaderHygiene : DiagGroup<"header-hygiene">; def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">; def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">; def GNUUnionCast : DiagGroup<"gnu-union-cast">; +def

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/13] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,97 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/12] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @PiotrZSL , I ran it on simple codebases & it looks good. I havent tried it on llvm codebase. it was taking a lot of time on my pc. https://github.com/llvm/llvm-project/pull/84481 ___ cfe-commits mailing list

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
11happy wrote: humble reminder @AaronBallman , @shafik https://github.com/llvm/llvm-project/pull/88489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Hello @vincent-mailhol thank you for the review I have made the suggested changed. https://github.com/llvm/llvm-project/pull/88489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-18 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/88489 >From bc08f479ba483e1582304ca103dbd92481108f12 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Apr 2024 14:56:42 +0530 Subject: [PATCH 1/3] add new flag -Wpointer-integer-ordered-compare Signed-off-by:

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/88489 >From bc08f479ba483e1582304ca103dbd92481108f12 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 12 Apr 2024 14:56:42 +0530 Subject: [PATCH 1/2] add new flag -Wpointer-integer-ordered-compare Signed-off-by:

[clang] Add new flag -Wpointer-integer-ordered-compare (PR #88489)

2024-04-12 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/88489 **Overview:** This pull request fixes #88090 where a false negative issue related to `-Wpointer-integer-compare` failing on comparison between a pointer and zero. **Testing:** - Tested the updated code. -

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-08 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Humble reminder! @PiotrZSL https://github.com/llvm/llvm-project/pull/84481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/11] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/11] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,81 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +int foo(){ +return 5; +} + +int bar(){ +return 4; +} + +class fun{ +public: +int A; +double B; +fun(){ +A = 5; +B = 5.4; +} +}; + +void f(){ +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,25 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for missing parentheses in mathematical expressions that involve operators +of different priorities. Parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,112 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
@@ -129,6 +129,12 @@ New checks Replaces certain conditional statements with equivalent calls to ``std::min`` or ``std::max``. +- New :doc:`readability-math-missing-parentheses 11happy wrote: done https://github.com/llvm/llvm-project/pull/84481

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-04-01 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 01/10] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-29 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,86 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-29 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,86 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-29 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,86 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-29 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/9] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-26 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,25 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for missing parentheses in mathematical expressions that involve operators +of different priorities. Parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-26 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/8] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-25 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,87 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-25 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,87 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-25 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,87 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-25 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/7] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-25 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,25 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for missing parentheses in mathematical expressions that involve operators +of different priorities. Parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/6] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/5] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for mising parantheses in mathematical expressions that involve operators +of different priorities. +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for mising parantheses in mathematical expressions that involve operators 11happy wrote: done

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,31 @@ +//===--- MathMissingParenthesesCheck.h - clang-tidy -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Check for mising parantheses in mathematical expressions that involve operators +of different priorities. + +Before: +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,31 @@ +//===--- MathMissingParenthesesCheck.h - clang-tidy -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,76 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +int foo(){ +return 5; +} + +int bar(){ +return 4; +} + +class fun{ +public: +int A; +double B; +fun(){ +A = 5; +B = 5.4; +} +}; + +void f(){ +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-24 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/5] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-20 Thread Bhuminjay Soni via cfe-commits
11happy wrote: > Not bad, still few issues left, mainly with `getOpcode`. Thanks for your review! Update: I will update the PR with the requested changes after 24 as I have mid semester exams from 21-24. https://github.com/llvm/llvm-project/pull/84481

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/81976 >From 07c73f087a430f5115ecdfec23730c5afcab37f3 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 16 Feb 2024 14:26:36 +0530 Subject: [PATCH 1/3] fix unnecessary warning when using bitand with boolean

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
11happy wrote: currently the macro definition for both `&` and `bitand` is not giving any warning however should the `&` one warn? or current working is correct behaviour as expected? https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
@@ -45,8 +45,8 @@ void test(boolean a, boolean b, int *p, volatile int *q, int i) { b = bar() & (i > 4); b = (i == 7) & foo(); #ifdef __cplusplus - b = foo() bitand bar(); // expected-warning {{use of bitwise '&' with boolean operands}} - //

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
@@ -16191,12 +16191,24 @@ static void AnalyzeImplicitConversions( BO->getRHS()->isKnownToHaveBooleanValue() && BO->getLHS()->HasSideEffects(S.Context) && BO->getRHS()->HasSideEffects(S.Context)) { - S.Diag(BO->getBeginLoc(),

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
@@ -16191,12 +16191,24 @@ static void AnalyzeImplicitConversions( BO->getRHS()->isKnownToHaveBooleanValue() && BO->getLHS()->HasSideEffects(S.Context) && BO->getRHS()->HasSideEffects(S.Context)) { - S.Diag(BO->getBeginLoc(),

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-03-16 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/81976 >From 07c73f087a430f5115ecdfec23730c5afcab37f3 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 16 Feb 2024 14:26:36 +0530 Subject: [PATCH 1/2] fix unnecessary warning when using bitand with boolean

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +// FIXME: Add something that triggers the check here. + +int foo(){ +return 5; +} + +int bar(){ +return 4; +} + +class fun{ +public: +int A; +double B; +fun(){ +

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,19 @@ +.. title:: clang-tidy - readability-math-missing-parentheses + +readability-math-missing-parentheses + + +Checks for mathematical expressions that involve operators of different priorities. 11happy wrote:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +// FIXME: Add something that triggers the check here. 11happy wrote: done https://github.com/llvm/llvm-project/pull/84481 ___

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,68 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/4] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-15 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/3] add clang-tidy check readability-math-missing-parentheses

[clang] Diagnose misuse of the cleanup attribute (PR #80040)

2024-03-13 Thread Bhuminjay Soni via cfe-commits
11happy wrote: > It looks like it passed on your last commit but you have a conflict now which > you need to resolve. > > Can you merge or do you need help with that? I tried to resolve the merge conflict but the resolve editor is just stuck on loading on Vs Code may be as it have 2

[clang] [clang-tools-extra] [llvm] Diagnose misuse of the cleanup attribute (PR #80040)

2024-03-13 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/80040 error: too big or took too long to generate ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,42 @@ +// RUN: %check_clang_tidy %s readability-math-missing-parentheses %t + +// FIXME: Add something that triggers the check here. +void f(){ +//CHECK-MESSAGES: :[[@LINE+2]]:13: warning: add parantheses to clarify the precedence of operations

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -100,6 +100,12 @@ Improvements to clang-tidy New checks ^^ +- New :doc:`readability-math-missing-parentheses + ` check. + + Checks for mathematical expressions that involve operators + of different priorities. 11happy wrote: done

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,167 @@ +//===--- MathMissingParenthesesCheck.cpp - clang-tidy -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Are there any more changes for this PR required from my end? Thank you https://github.com/llvm/llvm-project/pull/82872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-11 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/84481 >From 8fdf6306085ed4cf0f77b7e718e374e9f65fedf9 Mon Sep 17 00:00:00 2001 From: 11happy Date: Fri, 8 Mar 2024 19:02:47 +0530 Subject: [PATCH 1/2] add clang-tidy check readability-math-missing-parentheses

[clang-tools-extra] Add clang-tidy check readability-math-missing-parentheses (PR #84481)

2024-03-08 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/84481 **Overview:** This pull request fixes #80850 where author suggests adding a readability check to detect missing parentheses around mathematical expressions when operators of different priorities are used.

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -94,6 +94,7 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The `-Wreturn-type` flag has been modified to split some of its functionality into `-Wreturn-mismatch` flag. 11happy wrote: done

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s + +// Test that -Wreturn-mismatch is enabled and -Wreturn-type is disabled. + +int foo(void) __attribute__((noreturn)); +int bar(void); + +void test1() { 11happy

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s + +// Test that -Wreturn-mismatch is enabled and -Wreturn-type is disabled. + +int foo(void) __attribute__((noreturn)); +int bar(void); + +void test1() { + return 1; //

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s + +// Test that -Wreturn-mismatch is enabled and -Wreturn-type is disabled. + +int foo(void) __attribute__((noreturn)); +int bar(void); + +void test1() { + return 1; //

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s + +// Test that -Wreturn-mismatch is enabled and -Wreturn-type is disabled. + +int foo(void) __attribute__((noreturn)); +int bar(void); + +void test1() { + return 1; //

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s 11happy wrote: done https://github.com/llvm/llvm-project/pull/82872 ___ cfe-commits mailing list

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wreturn-type -Wno-return-mismatch -fsyntax-only -verify %s 11happy wrote: done https://github.com/llvm/llvm-project/pull/82872 ___ cfe-commits mailing list

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -Wno-return-type -Wreturn-mismatch -fsyntax-only -verify %s + +// Test that -Wreturn-mismatch is enabled and -Wreturn-type is disabled. + +int foo(void) __attribute__((noreturn)); +int bar(void); + +void test1() { + return 1; //

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/82872 >From 557ee75d60f0fdb4dd2b353c819b4f22f71b46d7 Mon Sep 17 00:00:00 2001 From: 11happy Date: Sat, 24 Feb 2024 13:50:30 +0530 Subject: [PATCH 1/3] add new flag -Wreturn-mismatch Signed-off-by: 11happy ---

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -1,5 +1,5 @@ // XFAIL: target=aarch64-pc-windows-msvc -// RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -w -o - | FileCheck %s +// RUN: %clang_cc1 -Wno-return-type -Wno-return-mismatch -Wno-unused-value -emit-llvm %s -w -o - | FileCheck %s

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -1,5 +1,5 @@ -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -Wno-int-conversion -Wno-strict-prototypes -Wno-tautological-constant-compare -Wtautological-unsigned-zero-compare -analyzer-checker=core,deadcode,alpha.core -std=gnu99 -analyzer-purge=none -verify %s

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -fsyntax-only -Wignored-qualifiers -Wno-error=return-type -Wno-error=implicit-int -verify -fblocks -Wno-unreachable-code -Wno-unused-value -Wno-strict-prototypes +// RUN: %clang_cc1 -triple x86_64-apple-darwin9

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-05 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy updated https://github.com/llvm/llvm-project/pull/82872 >From 557ee75d60f0fdb4dd2b353c819b4f22f71b46d7 Mon Sep 17 00:00:00 2001 From: 11happy Date: Sat, 24 Feb 2024 13:50:30 +0530 Subject: [PATCH 1/2] add new flag -Wreturn-mismatch Signed-off-by: 11happy ---

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-03-02 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Its a Humble Ping! https://github.com/llvm/llvm-project/pull/82872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] fix unnecessary warning when using bitand with boolean operators (PR #81976)

2024-02-24 Thread Bhuminjay Soni via cfe-commits
11happy wrote: Humble Ping! https://github.com/llvm/llvm-project/pull/81976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add new flag -Wreturn-mismatch (PR #82872)

2024-02-24 Thread Bhuminjay Soni via cfe-commits
https://github.com/11happy created https://github.com/llvm/llvm-project/pull/82872 **Overview:** This pull request fixes #72116 where a new flag is introduced for compatibility with GCC 14, the functionality of -Wreturn-type is modified to split some of its behaviors into -Wreturn-mismatch

  1   2   3   >