[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-05-29 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/5] [clang-tidy] Add check 'bugprone-inva

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-05-29 Thread Balázs Kéri via cfe-commits
balazske wrote: The check can now warn for (default) initializations that are recursively inside a type structure (members of structs, elements of arrays). In these cases it can look difficult to find the member or place where the value with enum type exists. The check now only makes a single

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-05-28 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,112 @@ +//===--- InvalidEnumDefaultInitializationCheck.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: Ap

[clang] [clang][ASTImporter] try fix missing Visit functions for issue #129393 (PR #138845)

2025-05-26 Thread Balázs Kéri via cfe-commits
balazske wrote: After #141104 clang should be buildable with dynamic linking too with this change included. Only tests should be added for the new node types, but I can do it only later. https://github.com/llvm/llvm-project/pull/138845 ___ cfe-commit

[clang] [clang][analyzer] Refine modeling of 'getcwd' in StdCLibraryFunctions checker (PR #141076)

2025-05-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/141076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Refine modeling of 'getcwd' in StdCLibraryFunctions checker (PR #141076)

2025-05-23 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/141076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-22 Thread Balázs Kéri via cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) { clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}} if (errno) {} // no warning - } else if (Path == NULL) {

[clang] [clang][analyzer] Refine modeling of 'getcwd' in StdCLibraryFunctions checker (PR #141076)

2025-05-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/141076 Add extra branches for the case when the buffer argument is NULL. From a82a775585ea473d6c29457b260848436071d0ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 22 May 2025 16:41:4

[clang] move ASTImporter into separate library (PR #140913)

2025-05-22 Thread Balázs Kéri via cfe-commits
balazske wrote: > > The problem was that nodes like `concepts::TypeRequirement` have > > constructors (and probably other related functions) defined in > > SemaConcepts.cpp. These can not be linked to the AST library, but are > > needed in `ASTImporter` for the new import functions. > > Can y

[clang] move ASTImporter into separate library (PR #140913)

2025-05-21 Thread Balázs Kéri via cfe-commits
balazske wrote: This change can help to fix issue #129393 . https://github.com/llvm/llvm-project/pull/140913 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] move ASTImporter into separate library (PR #140913)

2025-05-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/140913 It became necessary to add `Sema` as dependency of `ASTImporter`. This is needed to implement import of concept related nodes. `Sema` can not be a dependency of `AST`, but this split of `ASTImporter` makes it po

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-21 Thread Balázs Kéri via cfe-commits
balazske wrote: I have renamed the check, if OK the class name will be changed too (in a new commit). https://github.com/llvm/llvm-project/pull/140086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/140086 From 65d44a4eb9621e49a96f1ac43e5a1bbd6691dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 15 May 2025 17:41:16 +0200 Subject: [PATCH 1/3] [clang-tidy] Added check 'bugprone-fu

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-21 Thread Balázs Kéri via cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) { clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}} if (errno) {} // no warning - } else if (Path == NULL) {

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
balazske wrote: The current code is not finished. I want to check for false positives and probably add options to disable check at destructors and operators. https://github.com/llvm/llvm-project/pull/140086 ___ cfe-commits mailing list cfe-commits@lis

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.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: Apa

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.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: Apa

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.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: Apa

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.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: Apa

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,74 @@ +//===--- FunctionVisibilityChangeCheck.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: Apa

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,43 @@ +.. title:: clang-tidy - bugprone-function-visibility-change + +bugprone-function-visibility-change +=== + +Check changes in visibility of C++ member functions in subclasses. The check balazske wrote: fixed https:

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
@@ -124,6 +124,11 @@ New checks pointer and store it as class members without handle the copy and move constructors and the assignments. +- New :doc:`bugprone-function-visibility-change + ` check. + + Check function visibility changes in subclasses. bala

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-19 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/140086 From 65d44a4eb9621e49a96f1ac43e5a1bbd6691dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 15 May 2025 17:41:16 +0200 Subject: [PATCH 1/2] [clang-tidy] Added check 'bugprone-fu

[clang] Ast importer visitors (PR #138838)

2025-05-17 Thread Balázs Kéri via cfe-commits
balazske wrote: I have now a working patch for "splitting" `ASTImporter` from `AST`. If this change will be accepted it is possible to add the new visit functions. The "split" change may require discussion on discord because it affects clang code layout. https://github.com/llvm/llvm-project/p

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/132242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Ast importer visitors (PR #138838)

2025-05-16 Thread Balázs Kéri via cfe-commits
balazske wrote: I checked the code and it looks difficult to split the `ASTImporter` to a separate component. The problem is that `ExternalASTSource` is used for AST related things and uses `ASTImporter` too. Another way to fix the problem is to move code of classes like `concepts::TypeRequire

[clang] Ast importer visitors (PR #138838)

2025-05-16 Thread Balázs Kéri via cfe-commits
balazske wrote: I think that `ASTImporter` must be moved into a new component (directory in "clang/lib") to fix this problem. `AST` is already dependency of `Sema` so `Sema` can not be added to `AST` as dependency (but could be added to `ASTImporter` if it would be a new component and `Sema` w

[clang] Ast importer visitors (PR #138838)

2025-05-16 Thread Balázs Kéri via cfe-commits
balazske wrote: We should ensure that the code builds with `-DBUILD_SHARED_LIBS=ON` cmake option. I think this is why I can not build it. I get this error: ``` /usr/bin/ld: tools/clang/lib/AST/CMakeFiles/obj.clangAST.dir/ASTImporter.cpp.o: in function `std::conditional, llvm::Expected, llvm::E

[clang-tools-extra] [clang-tidy] Added check 'bugprone-function-visibility-change' (PR #140086)

2025-05-15 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/140086 None From 65d44a4eb9621e49a96f1ac43e5a1bbd6691dc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 15 May 2025 17:41:16 +0200 Subject: [PATCH] [clang-tidy] Added check 'bugprone-

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-05-09 Thread Balázs Kéri via cfe-commits
balazske wrote: I have fixed the review issues. https://github.com/llvm/llvm-project/pull/136823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-05-09 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/4] [clang-tidy] Add check 'bugprone-inva

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-08 Thread Balázs Kéri via cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) { clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}} if (errno) {} // no warning - } else if (Path == NULL) {

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-07 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-07 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)

2025-05-07 Thread Balázs Kéri via cfe-commits
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) { clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}} clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}} if (errno) {} // no warning - } else if (Path == NULL) {

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-07 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 19 Mar 2025 16:09:04 +0100 Subject: [PATCH 1/6] [clang-tidy] Add check bugprone-misle

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,58 @@ +//===--- MisleadingSetterOfReferenceCheck.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: Apa

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-05-06 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 19 Mar 2025 16:09:04 +0100 Subject: [PATCH 1/5] [clang-tidy] Add check bugprone-misle

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-05-06 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/128735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-04-30 Thread Balázs Kéri via cfe-commits
balazske wrote: I am now not really sure what happens, if there is a single anonymous namespace for a TU or there are separate ones for the anonymous namespaces in for example `extern "C"` blocks (and how it should work according to the C++ standard). Probably adding more tests where there is

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/3] [clang-tidy] Add check 'bugprone-inva

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-04-25 Thread Balázs Kéri via cfe-commits
balazske wrote: The current behavior is the same for named or anonymous namespace: If there is an existing namespace with same name in the target ("To") TU, the imported one is merged into this (this is what was wrong before this fix, the anonymous namespace was not merged if it was inside a `

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/136823 From 4ce7497bb0dc89de3b9f139177c295291e7d3e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Thu, 17 Apr 2025 17:36:03 +0200 Subject: [PATCH 1/2] [clang-tidy] Add check 'bugprone-inva

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread Balázs Kéri via cfe-commits
balazske wrote: > I wonder if behavior of this check should be an extension to > [optin.core.EnumCastOutOfRange](https://clang.llvm.org/docs/analyzer/checkers.html#optin-core-enumcastoutofrange). > Sure, we don't have `static_cast` here but it's still considered as "cast > out of range"? Maybe

[clang-tools-extra] [clang-tidy] Add check 'bugprone-invalid-enum-default-initialization' (PR #136823)

2025-04-24 Thread Balázs Kéri via cfe-commits
@@ -0,0 +1,114 @@ +//===--- InvalidEnumDefaultInitializationCheck.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: Ap

[clang] [clang][analyzer] Fix a possible crash in CastSizeChecker (PR #134387)

2025-04-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/134387 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-04-05 Thread Balázs Kéri via cfe-commits
@@ -436,9 +436,9 @@ class StdLibraryFunctionsChecker llvm::raw_ostream &Out) const override; ValueConstraintPtr negate() const override { - NotNullBufferConstraint Tmp(*this); + BufferNullnessConstraint Tmp(*this); Tmp.Cannot

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-04-05 Thread Balázs Kéri via cfe-commits
balazske wrote: The checker had only a few results from the usual C projects where we test it, but more of these are difficult to understand. [This](https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=vim_v8.2.1920_fixedaddr_on_test&newcheck=vim_v8.2.1920_fixedaddr_off_

[clang] [clang][analyzer] Fix a possible crash in CastSizeChecker (PR #134387)

2025-04-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/134387 From 8936d300045d96d8719ecee04c36b2b0cb5d96d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 4 Apr 2025 16:05:28 +0200 Subject: [PATCH 1/2] [clang][analyzer] Fix a possible crash

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-04-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 19 Mar 2025 16:09:04 +0100 Subject: [PATCH 1/4] [clang-tidy] Add check bugprone-misle

[clang] [clang][analyzer] Fix a possible crash in CastSizeChecker (PR #134387)

2025-04-04 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/134387 None From 8936d300045d96d8719ecee04c36b2b0cb5d96d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 4 Apr 2025 16:05:28 +0200 Subject: [PATCH] [clang][analyzer] Fix a possible cras

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-04-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 19 Mar 2025 16:09:04 +0100 Subject: [PATCH 1/3] [clang-tidy] Add check bugprone-misle

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-04-03 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132242 From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 19 Mar 2025 16:09:04 +0100 Subject: [PATCH 1/2] [clang-tidy] Add check bugprone-misle

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-26 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/132404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-25 Thread Balázs Kéri via cfe-commits
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply( return State->assume(L, CannotBeNull); } -void StdLibraryFunctionsChecker::NotNullConstraint::describe( +void StdLibraryFunctionsChecker::NullnessConstraint::describe( Descripti

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-24 Thread Balázs Kéri via cfe-commits
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply( return State->assume(L, CannotBeNull); } -void StdLibraryFunctionsChecker::NotNullConstraint::describe( +void StdLibraryFunctionsChecker::NullnessConstraint::describe( Descripti

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/132404 From ecbda095420a1ec300fd4793600c813acc310475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 21 Mar 2025 15:02:38 +0100 Subject: [PATCH 1/2] [clang][analyzer] Move 'alpha.core.Fi

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-24 Thread Balázs Kéri via cfe-commits
balazske wrote: [This single report](https://codechecker-demo.eastus.cloudapp.azure.com/Default/report-detail?run=qtbase_v6.2.0_fixedaddr_on_test&is-unique=off&diff-type=New&checker-name=alpha.core.FixedAddressDereference&report-hash=fda7750beaa79c7f9c602febcf9a7bb9&report-id=6953322&report-file

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-24 Thread Balázs Kéri via cfe-commits
balazske wrote: On projects memcached,tmux,curl,twin,vim,openssl,sqlite,ffmpeg,postgres only the following results were found: | Project | Resolved Reports | New Reports | |-|-|--| | vim | [1 reports](https://codechecker-demo.eastus.cloudapp.azure.com/Default

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-22 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/131374 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Move 'alpha.core.FixedAddressDereference' out of alpha (PR #132404)

2025-03-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/132404 None From ecbda095420a1ec300fd4793600c813acc310475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Fri, 21 Mar 2025 15:02:38 +0100 Subject: [PATCH] [clang][analyzer] Move 'alpha.core.F

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. Rename looks good. According to the format check code should be reformatted. Do not forget to remove the "discuss" part from the commit title. https://github.com/llvm/llvm-project/pull/131374 ___

[clang-tools-extra] [clang-tidy] Add check bugprone-misleading-setter-of-reference (PR #132242)

2025-03-20 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/132242 There can be concerns about the usefulness of this check but for some code it can be useful. From e3064b600ea726ab7b3dea054e9f11e1ce028297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Da

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-18 Thread Balázs Kéri via cfe-commits
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply( return State->assume(L, CannotBeNull); } -void StdLibraryFunctionsChecker::NotNullConstraint::describe( +void StdLibraryFunctionsChecker::NullnessConstraint::describe( Descripti

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-03-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/128735 From 3fae6f2bed93144561138704accb43c6544cfb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Tue, 25 Feb 2025 17:17:02 +0100 Subject: [PATCH 1/2] [clang][ASTImporter] Fix AST import if

[clang] [NFC][Static Analyzer] Rename and discuss about `NotNullConstraint` & `NotNullBufferConstraint` (PR #131374)

2025-03-17 Thread Balázs Kéri via cfe-commits
@@ -1165,7 +1165,7 @@ ProgramStateRef StdLibraryFunctionsChecker::NotNullConstraint::apply( return State->assume(L, CannotBeNull); } -void StdLibraryFunctionsChecker::NotNullConstraint::describe( +void StdLibraryFunctionsChecker::NullnessConstraint::describe( Descripti

[clang] [clang][analyzer] Add BugReporterVisitor messages for non-null fixed pointer (PR #129557)

2025-03-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/129557 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Add BugReporterVisitor messages for non-null fixed pointer (PR #129557)

2025-03-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/129557 From 8006fde8ad615dffcaf38bc017b58d6bbed59ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Mar 2025 17:57:19 +0100 Subject: [PATCH 1/4] [clang][analyzer] Add BugReporterVisito

[clang] [clang][analyzer] Add BugReporterVisitor messages for non-null fixed pointer (PR #129557)

2025-03-06 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/129557 From 8006fde8ad615dffcaf38bc017b58d6bbed59ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Mar 2025 17:57:19 +0100 Subject: [PATCH 1/3] [clang][analyzer] Add BugReporterVisito

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-28 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/6] [clang][analyzer] Add checker 'alpha.c

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-26 Thread Balázs Kéri via cfe-commits
@@ -395,6 +395,19 @@ ANALYZER_OPTION( "flex\" won't be analyzed.", true) +ANALYZER_OPTION( +bool, ShouldSuppressAddressSpaces, "suppress-all-address-spaces", balazske wrote: I think that "ignore-all-address-spaces" would be really problematic but

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-02-26 Thread Balázs Kéri via cfe-commits
balazske wrote: I could not find out why the buildkite check failures appear. https://github.com/llvm/llvm-project/pull/128735 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-02-26 Thread Balázs Kéri via cfe-commits
balazske wrote: I meant that I did not verify where a namespace declaration is allowed, if it is allowed with another declaration as parent (which is not a `LinkageSpecDecl` and not `NamespaceDecl` and not `TranslationUnitDecl`). It looks likely that no other parent is possible. https://githu

[clang] [clang][ASTImporter] Fix AST import if anonymous namespaces are merged (PR #128735)

2025-02-25 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/128735 I discovered one faulty case that is shown in the second of the added tests (an anonymous namespace is imported that resides in a `extern "C"` block). I did not check for other possibilities for namespaces tha

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-21 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/5] [clang][analyzer] Add checker 'alpha.c

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-18 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/4] [clang][analyzer] Add checker 'alpha.c

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/3] [clang][analyzer] Add checker 'alpha.c

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/127409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -40,17 +40,28 @@ enum class OpenVariant { OpenAt }; +static CachedMacroValue getCreateFlagValue(const ASTContext &Ctx, + const Preprocessor &PP) { + CachedMacroValue MacroVal("O_CREAT", PP); + if (MacroVal.hasValue()) +retur

[clang] [analyzer] Delay the checker constructions after parsing (PR #127409)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -73,6 +73,23 @@ Nullability getNullabilityAnnotation(QualType Type); /// returned. std::optional tryExpandAsInteger(StringRef Macro, const Preprocessor &PP); +class CachedMacroValue { balazske wrote: What is the advantage of using this instead of just `std

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -1,6 +1,6 @@ // NOTE: Use '-fobjc-gc' to test the analysis being run twice, and multiple reports are not issued. -// RUN: %clang_analyze_cc1 -triple i386-apple-darwin10 -analyzer-checker=core,alpha.core,osx.cocoa.AtSync -Wno-strict-prototypes -Wno-pointer-to-int-cast -verif

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -1,7 +1,163 @@ // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify %s -// expected-no-diagnostics -void foo(void) { +extern void __assert_fail (__const char *__assertion, __const char *__file, +unsigned int __line, __const char *__function) + __attri

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -129,6 +129,8 @@ The ``SuppressAddressSpaces`` option suppresses warnings for null dereferences of all pointers with address spaces. You can disable this behavior with the option ``-analyzer-config core.NullDereference:SuppressAddressSpaces=false``. +Value of this option is

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-17 Thread Balázs Kéri via cfe-commits
@@ -155,30 +162,47 @@ static bool isDeclRefExprToReference(const Expr *E) { void DereferenceChecker::reportBug(DerefKind K, ProgramStateRef State, const Stmt *S, CheckerContext &C) const { - if (!CheckNullDereference) { -C.addSink(); -

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-14 Thread Balázs Kéri via cfe-commits
balazske wrote: The checker is alpha because there are known problems with it which I plan to fix later. A problem is with the bugpath messages where a constant pointer was assumed to be a null pointer but after this checker (or even before it?) this is not true. https://github.com/llvm/llvm-p

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-14 Thread Balázs Kéri via cfe-commits
balazske wrote: It may cause confusion that "NullDereference" checker checks not only null dereference but undefined pointer and label address too. Probably these checks (specially label address) can be moved into this checker. (Or add the new check to NullDereference without a new checker?)

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/127191 From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH 1/2] [clang][analyzer] Add checker 'alpha.c

[clang] [clang][analyzer] Add checker 'alpha.core.FixedAddressDereference' (PR #127191)

2025-02-14 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/127191 None From 1f2ad6d5ce6f11fb031ec2175527f56ea86761ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 3 Feb 2025 15:35:31 +0100 Subject: [PATCH] [clang][analyzer] Add checker 'alpha

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-28 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/124273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-27 Thread Balázs Kéri via cfe-commits
https://github.com/balazske updated https://github.com/llvm/llvm-project/pull/124273 From 4109a5166b544c33af333505883b414db7c0c14d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Wed, 22 Jan 2025 17:55:51 +0100 Subject: [PATCH 1/3] fix test --- clang/lib/AST/ASTImport

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-27 Thread Balázs Kéri via cfe-commits
balazske wrote: It seems that this test is not reducible any further (except very small changes) (to get the original crash). I could remove only few lines. https://github.com/llvm/llvm-project/pull/124273 ___ cfe-commits mailing list cfe-commits@list

[clang] [clang][ASTImporter] Import source location of explicit object parameter instead of copying it (PR #124305)

2025-01-27 Thread Balázs Kéri via cfe-commits
https://github.com/balazske approved this pull request. https://github.com/llvm/llvm-project/pull/124305 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-24 Thread Balázs Kéri via cfe-commits
balazske wrote: If this case is not handled, the following `setDescribedFunctionTemplate` will run into an assertion. The case happens in the test code. What exactly happens is that because of the `__get_first_arg` mismatch a field `basic_string::_M_allocated_capacity` is missing from `basic_s

[clang] [clang][ASTImporter][test] Add test for importing explicit object parameter (PR #124305)

2025-01-24 Thread Balázs Kéri via cfe-commits
@@ -3441,13 +3441,33 @@ TEST_P(ASTImporterOptionSpecificTestBase, ImportParmVarDecl) { ASSERT_TRUE(FromVar); ASSERT_TRUE(FromVar->hasUninstantiatedDefaultArg()); ASSERT_TRUE(FromVar->getUninstantiatedDefaultArg()); + ASSERT_FALSE(FromVar->isExplicitObjectParameter());

[clang] [clang][ASTImporter] Fix possible crash at import of function template (PR #124273)

2025-01-24 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/124273 During import of a function template at specific conditions an assertion "TemplateOrSpecialization.isNull()" can be triggered. This can happen when the new AST is already incompatible after import failures. Prob

[clang] [clang][ASTImporter] Fix unused variable warning (NFC) (PR #122686)

2025-01-13 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/122686 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][ASTImporter] Fix unused variable warning (NFC) (PR #122686)

2025-01-13 Thread Balázs Kéri via cfe-commits
https://github.com/balazske created https://github.com/llvm/llvm-project/pull/122686 None From 1b11dfc89cc81c1d48479cdcc7a4f5936d4ddb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20K=C3=A9ri?= Date: Mon, 13 Jan 2025 11:33:40 +0100 Subject: [PATCH] [clang][ASTImporter] Fix unused vari

[clang] [clang][ASTImporter] Not using primary context in lookup table (PR #118466)

2025-01-13 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/118466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Split NullDereferenceChecker into modeling and reporting (PR #122139)

2025-01-10 Thread Balázs Kéri via cfe-commits
https://github.com/balazske closed https://github.com/llvm/llvm-project/pull/122139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Split NullDereferenceChecker into modeling and reporting (PR #122139)

2025-01-09 Thread Balázs Kéri via cfe-commits
https://github.com/balazske edited https://github.com/llvm/llvm-project/pull/122139 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   >