[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-09 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121768 From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 18 Nov 2024 11:36:03 +0100 Subject: [PATCH 1/5] [

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-09 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm, NonTypeTemplateParmDecl *OrigConstrainedParm, SourceLocation Elli

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-08 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1228,35 +1228,45 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm, NonTypeTemplateParmDecl *OrigConstrainedParm, SourceLocation Elli

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, << NewConstrainedParm->getTypeSourceInfo() ->getTypeLoc() .getSourceRange(); +NewConstrainedParm->setPlaceholderTypeConstraint( +RecoveryExpr::Create(Contex

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121768 From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 18 Nov 2024 11:36:03 +0100 Subject: [PATCH 1/3] [

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, << NewConstrainedParm->getTypeSourceInfo() ->getTypeLoc() .getSourceRange(); +NewConstrainedParm->setPlaceholderTypeConstraint( +RecoveryExpr::Create(Contex

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -0,0 +1,54 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang_cc1 -std=c++20 mod.cppm -emit-module-interface -o mod.pcm -fallow-pcm-with-compiler-errors -verify +// RUN: %clang_cc1 -std=c++20 main.cpp -fmodule-file=mod=mod.pcm -verify -fallow-pcm

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1235,15 +1235,24 @@ bool Sema::AttachTypeConstraint(AutoTypeLoc TL, << NewConstrainedParm->getTypeSourceInfo() ->getTypeLoc() .getSourceRange(); +NewConstrainedParm->setPlaceholderTypeConstraint( +RecoveryExpr::Create(Contex

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121768 From da2bbf99b8430d8b6aa6bf7969c9825b4d94219b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 18 Nov 2024 11:36:03 +0100 Subject: [PATCH 1/2] [

[clang] [clang][Sema] Fix initialization of `NonTypeTemplateParmDecl`... (PR #121768)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/121768 ...when there are invalid constraints. When attaching a `TypeConstraint`, in case of error, the trailing pointer that is supposed to point to the constraint is left uninitialized. Sometime

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Thanks for the review! Would you mind doing the merge? I do not have permission. https://github.com/llvm/llvm-project/pull/121550 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/6] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/6] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/7] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -7230,6 +7230,9 @@ void ASTWriter::CompletedImplicitDefinition(const FunctionDecl *D) { if (!D->isFromASTFile()) return; // Declaration not imported from PCH. + if (!D->doesThisDeclarationHaveABody()) +return; // The function definition may not have a body due t

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/6] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6092,12 +6092,14 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // An updated body is emitted last, so that the reader doesn't need // to skip over the lazy body to reach statements for other records. - if (Kind == UPD_CXX_ADDED_FUNCTION_D

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/5] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6092,9 +6092,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // An updated body is emitted last, so that the reader doesn't need // to skip over the lazy body to reach statements for other records. - if (Kind == UPD_CXX_ADDED_FUNCTION_DE

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6092,9 +6092,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // An updated body is emitted last, so that the reader doesn't need // to skip over the lazy body to reach statements for other records. - if (Kind == UPD_CXX_ADDED_FUNCTION_DE

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/4] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/3] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6227,8 +6227,10 @@ void ASTWriter::WriteDeclUpdatesBlocks(ASTContext &Context, // Add a trailing update record, if any. These must go last because we // lazily load their attached statement. if (!GeneratingReducedBMI || !CanElideDeclDef(D)) { - if (HasUpda

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/121550 From fe4adf2f95aeb72436eead3567767c8c539811c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 3 Jan 2025 08:58:23 +0100 Subject: [PATCH 1/2] [c

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > You hope the linter doesn't give up `some.cc` if `mod` contains some errors? > If yes, that makes sense to me. Precisely. > But why Sanitizers? IIRC, they should only work if the project compiles. Or > are you saying the static analyzer? Sorry, my mind

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-06 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > Out of curiosity (not a blocking issue), why do you want this feature for > C++20 modules? Sanitizers, linters and indexers have to deal with code using non supported C++ language features or extensions. This is also true for C++20 modules. While conceiv

[clang] [clang] Do not serialize function definitions without a body (PR #121550)

2025-01-03 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/121550 An instantiated templated function definition may not have a body due to parsing errors inside the templated function. When serializing, an assert is triggered inside `ASTRecordWriter::Add

[clang] [clang] Allow generating module interfaces with parsing errors (PR #121485)

2025-01-02 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/121485 Fixes a regression introduced in commit da00c60dae0040185dc45039c4397f6e746548e9 This functionality was originally added in commit 5834996fefc937d6211dc8c8a5b200068753391a From dcdc88688d

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2025-01-01 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/119711 From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 11 Dec 2024 15:43:58 +0100 Subject: [PATCH 1/4] A

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2024-12-18 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/119711 From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 11 Dec 2024 15:43:58 +0100 Subject: [PATCH 1/4] A

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2024-12-18 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/119711 From d398fa13c2fa141954c79ca68a59c6ac506b393f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 11 Dec 2024 15:43:58 +0100 Subject: [PATCH 1/3] A

[clang] [clang][Sema] Fix type of an statement expression ending with an atomic type (PR #119711)

2024-12-12 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/119711 When a statement expression's last statement is an atomic variable, GCC and Clang disagree on the type of the expression. This can be made apparent using `typeof` and forcing a diagnostic

[clang] [clang] Fix non-deterministic infinite recursion... (PR #118288)

2024-12-10 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Thanks! Can you do the merge? I do not have the rights. Also, would it make sense to backport to 19? https://github.com/llvm/llvm-project/pull/118288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

[clang] [clang] Fix non-deterministic infinite recursion... (PR #118288)

2024-12-02 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/118288 From 998ea6184faa12f6137d5b20f0a5f9279b14623a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 2 Dec 2024 10:48:52 +0100 Subject: [PATCH 1/2] [c

[clang] [clang] Fix non-deterministic infinite recursion... (PR #118288)

2024-12-02 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/118288 ...in `ASTContext::getAutoTypeInternal` Given ```cpp template < typename > concept C1 = true; template < typename , auto > concept C2 = true; template < C1 auto V, C2< V > auto> struct S

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-11 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > Do you need someone to commit these changes for you? (If so, I can apply the > changes myself and land them.) Yes, please, I can't merge myself. https://github.com/llvm/llvm-project/pull/109147 ___ cfe-commits m

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -141,10 +143,11 @@ struct PrintingPolicy { unsigned SuppressUnwrittenScope : 1; /// Suppress printing parts of scope specifiers that correspond - /// to inline namespaces, where the name is unambiguous with the specifier + /// to inline namespaces. + /// If Redudant,

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-11 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/8] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-11 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/7] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/6] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/5] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/4] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > > Or even SuppressInlineNamespace should be changed from bool to some enum > > like None, Redundant, All. > > I think this is the suggestion I'd prefer; it's cleaner than adding a second > boolean option. Agreed. And changes. > Make sure that all curre

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/3] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/3] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-09 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/2] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-10-09 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Ping (@PiotrZSL ?) https://github.com/llvm/llvm-project/pull/109147 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix eager skipping on new with unknown type and no new-initializer (PR #110133)

2024-09-26 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/110133 i.e., in `function(new Unknown);` the parser should skip only until the semicolon. Before this change, everything was skipped until a balanced closing parenthesis or brace was found. This

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-09-23 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > Also, it needs a release note I think for the matcher change. Added. > I have no problem with the code here, but don't know enough about ASTMatchers > to be able to review this for 'well justified'. Do we have someone besides > Aaron who does? FWIW this

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-09-23 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/109147 From d369d26aad940299eb98ff0c322614043144c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Mon, 24 Jul 2023 13:56:29 +0200 Subject: [PATCH 1/2] [

[clang] [clang] Ignore inline namespace for `hasName` (PR #109147)

2024-09-18 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/109147 Add a new flag `AlwaysSuppressInlineNamespace` to `PrintingPolicy` that is explicit about *always* removing inline namespaces regardless of ambiguity. Specializing a template from an inlin

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-18 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Thanks! Do you mind merging the PR? I do not have permission to do so. https://github.com/llvm/llvm-project/pull/108021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-18 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/108021 From b414b6e184fc566efd6a2dbe631ee68a25b461a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Fri, 16 Jun 2023 18:01:33 +0200 Subject: [PATCH 1/3] [

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-13 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource edited https://github.com/llvm/llvm-project/pull/108021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-13 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -446,7 +446,12 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT, : InitializationKind::CreateCast(/*type range?*/ range); InitializationSequence sequence(S, entity, initKind, src); - assert(sequence.Failed() && "initialization succeeded on second try?");

[clang] [clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource edited https://github.com/llvm/llvm-project/pull/108021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Fix wrong assumption in `tryDiagnoseOverloadedCast` (PR #108021)

2024-09-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/108021 A constructor may have failed to be used due to a broken templated dependent parameter. The `InitializationSequence` itself can succeed. Due to the assumption that it is in a failed state,

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-18 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/96509 From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 1 Jun 2023 16:30:54 +0200 Subject: [PATCH 1/6] [Se

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-17 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/96509 From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 1 Jun 2023 16:30:54 +0200 Subject: [PATCH 1/5] [Se

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-17 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > LGTM. Do you need me to merge that for you? Yes, thanks! https://github.com/llvm/llvm-project/pull/96509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-17 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > Thanks for the fix; I think this makes sense. Can you provide a release note? Added (and fixed the conflict) https://github.com/llvm/llvm-project/pull/96509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-17 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/96509 From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 1 Jun 2023 16:30:54 +0200 Subject: [PATCH 1/5] [Se

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/96509 From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 1 Jun 2023 16:30:54 +0200 Subject: [PATCH 1/5] [Se

[clang] [Sema] Fix assertion error in Sema::FindInstantiatedDecl (PR #96509)

2024-07-10 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource edited https://github.com/llvm/llvm-project/pull/96509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-10 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc)); } QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args); - if (T.i

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-05 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -6300,7 +6300,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, getTrivialTemplateArgumentLoc(UnpackedArg, QualType(), Loc)); } QualType T = CheckTemplateIdType(TemplateName(TD), Loc, Args); - if (T.i

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-05 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/96509 From 96b0c2c18c197a1ce03d31b01c14d1b18348e9ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Thu, 1 Jun 2023 16:30:54 +0200 Subject: [PATCH 1/2] [Se

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-07-02 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Ping (@cor3ntin, @Endilll ?) https://github.com/llvm/llvm-project/pull/96509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] Fix crash in Sema::FindInstantiatedDecl (PR #96509)

2024-06-24 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource created https://github.com/llvm/llvm-project/pull/96509 When looking for a template instantiation with a non-type parameter of unknown type and with a default value. This can happen when a template non-type parameter has a broken expression that

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Rebased and squashed into two commits that should be kept separate. https://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 18569fc14e2d9050acbc63c2367f9a1ec6f8577b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 1/2] [c

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,75 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + cha

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/24]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-22 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/23]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -376,3 +377,122 @@ void fflush_on_open_failed_stream(void) { } fclose(F); } + +void getline_null_file() { + char *buffer = NULL; + size_t n = 0; + getline(&buffer, &n, NULL); // expected-warning {{Stream pointer might be NULL}} +} + +void getdelim_null_file() { + ch

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/22]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1217,6 +1231,11 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, E.isStreamEof() ? ErrorFEof : ErrorFEof | ErrorFError; StateFailed = E.setStreamState( StateFailed, StreamState::getOpened(Desc, NewES, !NewES.isFEof())); + // On failure, the con

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource commented: Applied the feedback. By the way, when `StdLibraryFunctionsChecker` is refactored, I'd be happy to give a hand if you need updating these checkers (UnixAPI and Stream). https://github.com/llvm/llvm-project/pull/83027 __

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/20]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect( +SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-21 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1204,6 +1204,20 @@ void StreamChecker::evalGetdelim(const FnDescription *Desc, State->BindExpr(E.CE, C.getLocationContext(), RetVal); StateNotFailed = E.assumeBinOpNN(StateNotFailed, BO_GE, RetVal, E.getZeroVal(Call)); +// The buffer size `*n` must

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/19]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: Sorry for the force-push, but I have moved now the precondition checks to `UnixAPIChecker` after uplifting its API (now it uses `PreCall` instead of `PreStmt`). From my understanding, the previous implementation used a legacy way of handling them. The idea

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect( +SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1179,6 +1195,113 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef StreamChecker::ensureGetdelimBufferAndSizeCorrect( +SVal LinePtrPtrSVal, SVal SizePtrSVal, const Expr *LinePtrPtrExp

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-20 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From a061464b75ac02c21e5d74fc4dff8d8afdbba66b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 20 Mar 2024 10:49:08 +0100 Subject: [PATCH 01/18]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-19 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: @balazske would you agree with my proposal of keeping this logic in `UnixAPIChecker`? I am also happy with adding more NULL checks to `StreamChecker`, but I can understand your concerns about overreaching its scope. https://github.com/llvm/llvm-project/pul

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
alejandro-alvarez-sonarsource wrote: > Additionally, the checked preconditions look not exact. For example the POSIX > documentation for `getdelim` says: "If *n is non-zero, the application shall > ensure that *lineptr either points to an object of size at least *n bytes, or > is a null pointe

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -510,6 +517,14 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr, +CheckerContext &C, P

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr, +CheckerContext &C, P

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -1158,6 +1173,118 @@ void StreamChecker::evalUngetc(const FnDescription *Desc, const CallEvent &Call, C.addTransition(StateFailed); } +ProgramStateRef +StreamChecker::ensurePtrNotNull(SVal PtrVal, const Expr *PtrExpr, +CheckerContext &C, P

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
https://github.com/alejandro-alvarez-sonarsource updated https://github.com/llvm/llvm-project/pull/83027 From 5c919832f9176d4b1af1312a4ee7cf30b788958a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20=C3=81lvarez=20Ayll=C3=B3n?= Date: Wed, 21 Feb 2024 14:46:01 +0100 Subject: [PATCH 01/14]

[clang] [clang][analyzer] Model more getline/getdelim pre and postconditions (PR #83027)

2024-03-11 Thread Alejandro Álvarez Ayllón via cfe-commits
@@ -234,6 +235,9 @@ class StreamChecker : public Checkerhttps://github.com/llvm/llvm-project/pull/83027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   >