[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6308,60 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/12] Initial implementation --- .../bugprone/unchecked-option

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/11] Initial implementation --- .../bugprone/unchecked-option

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 01/10] Initial implementation --- .../bugprone/unchecked-option

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/9] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
@@ -3596,6 +3596,16 @@ bool FunctionDecl::isNoReturn() const { return false; } +std::optional FunctionDecl::getAnalyzerNoReturn() const { + if (isNoReturn()) +return true; + + if (auto *Attr = getAttr()) +return Attr->getValue(); + + return std::nullopt; -

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/8] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/8] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-15 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/8] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/7] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -5950,14 +5950,15 @@ TEST(TransferTest, ForStmtBranchWithoutConditionDoesNotExtendFlowCondition) { Code, [](const llvm::StringMap> &Results, ASTContext &ASTCtx) { -ASSERT_THAT(Results.keys(), UnorderedElementsAre("loop_body")); +// targe

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -50,37 +50,45 @@ void NoReturnFunctionChecker::checkPostCall(const CallEvent &CE, BuildSinks = getFunctionExtInfo(C->getType()).getNoReturn(); } - if (!BuildSinks && CE.isGlobalCFunction()) { -if (const IdentifierInfo *II = CE.getCalleeIdentifier()) { - /

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ edited https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/7] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/6] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6304,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6334,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -2833,8 +2834,37 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) { if (!FD->isVariadic()) findConstructionContextsForArguments(C); -if (FD->isNoReturn() || C->isBuiltinAssumeFalse(*Context)) - NoReturn = true; +if (!NoReturn) +

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/5] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/4] Initial implementation --- .../bugprone/unchecked-optional

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -69,6 +69,22 @@ void UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) { cxxMethodDecl(unless(hasDescendant(cxxMemberCallExpr(callee(cxxMethodDecl( hasName("operator="), ofClass(equalsBoundNode("class"; + // Checking that some ki

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/7] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -69,6 +69,22 @@ void UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) { cxxMethodDecl(unless(hasDescendant(cxxMemberCallExpr(callee(cxxMethodDecl( hasName("operator="), ofClass(equalsBoundNode("class"; + // Checking that some ki

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -189,6 +189,12 @@ Changes in existing checks calls of ``std::string`` constructor with char pointer, start position and length parameters. +- Improved :doc:`bugprone-unhandled-self-assignment + ` check by adding + an additional matcher that generalizes the copy-and-sw

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
@@ -189,6 +189,12 @@ Changes in existing checks calls of ``std::string`` constructor with char pointer, start position and length parameters. +- Improved :doc:`bugprone-unhandled-self-assignment negativ wrote: @EugeneZelenko fixed https://github.com/llvm

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/7] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-14 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/6] Checking that some kind of constructor is called and followe

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/4] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
@@ -6298,10 +6334,43 @@ static bool isImmediateSinkBlock(const CFGBlock *Blk) { // at least for now, but once we have better support for exceptions, // we'd need to carefully handle the case when the throw is being // immediately caught. - if (llvm::any_of(*Blk, [](const

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ ready_for_review https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/3] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
@@ -2835,8 +2835,37 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) { if (!FD->isVariadic()) findConstructionContextsForArguments(C); -if (FD->isNoReturn() || C->isBuiltinAssumeFalse(*Context)) - NoReturn = true; +if (!NoReturn) +

[clang] [clang-tools-extra] [clang]: Propagate `*noreturn` attributes in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ edited https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang]: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ edited https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang]: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ edited https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/3] Initial implementation --- .../bugprone/unchecked-optional

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/2] Initial implementation --- .../bugprone/unchecked-optional

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/6] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/5] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
negativ wrote: > Please mention changes in Release Notes. @EugeneZelenko done. https://github.com/llvm/llvm-project/pull/147066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/4] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/4] Checking that some kind of constructor is called and followe

[clang-tools-extra] [clang-tidy] Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-07 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/147066 >From 950b6dce92eb2a831e7bd7e7ba44b3e8cc354dd4 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Fri, 4 Jul 2025 17:13:20 +0300 Subject: [PATCH 1/3] Checking that some kind of constructor is called and followe

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-04 Thread Andrey Karlov via cfe-commits
https://github.com/negativ updated https://github.com/llvm/llvm-project/pull/146355 >From fc3b77d8c4b5dd264bd746ed997bcea6cddaf389 Mon Sep 17 00:00:00 2001 From: Andrey Karlov Date: Mon, 30 Jun 2025 17:05:41 +0300 Subject: [PATCH 1/2] Initial implementation --- .../bugprone/unchecked-optional

[clang-tools-extra] `clang-tidy`: Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-04 Thread Andrey Karlov via cfe-commits
https://github.com/negativ ready_for_review https://github.com/llvm/llvm-project/pull/147066 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] `clang-tidy`: Make `bugprone-unhandled-self-assignment` check more general (PR #147066)

2025-07-04 Thread Andrey Karlov via cfe-commits
https://github.com/negativ created https://github.com/llvm/llvm-project/pull/147066 This change enhances the `bugprone-unhandled-self-assignment` checker by adding an additional matcher that generalizes the copy-and-swap idiom pattern detection. # What Changed Added a new matcher that checks

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-01 Thread Andrey Karlov via cfe-commits
@@ -141,6 +141,42 @@ void nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo } } +void assertion_handler_imp() __attribute__((analyzer_noreturn)); + +void assertion_handler() { +do { + assertion_handler_imp(); +} while(0); +} + +void functi

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-01 Thread Andrey Karlov via cfe-commits
@@ -141,6 +141,42 @@ void nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo } } +void assertion_handler_imp() __attribute__((analyzer_noreturn)); + +void assertion_handler() { +do { + assertion_handler_imp(); +} while(0); +} + +void functi

[clang] [clang-tools-extra] `Clang`: `*noreturn` propagation in `CFG` (PR #146355)

2025-07-01 Thread Andrey Karlov via cfe-commits
https://github.com/negativ edited https://github.com/llvm/llvm-project/pull/146355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] `Clang`: `analyzer_noreturn` propagation in `CFG` (PR #146355)

2025-06-30 Thread Andrey Karlov via cfe-commits
https://github.com/negativ created https://github.com/llvm/llvm-project/pull/146355 ## Summary This PR extends `Clang`'s `CFG` analysis to automatically propagate `analyzer_noreturn` attributes through function call chains. When a function exclusively calls no-return functions, it is automati