[clang] [clang-repl] fix error recovery while parsing completely fails (PR #127087)

2025-02-19 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > Hmmm confused ! > > So does it really come down to the flag responsible for enabling assertions. > `LLVM_ENABLE_ASSERTIONS=ON` Seems like it. This is the only flag that explains this behaviour. https://github.com/llvm/llvm-project/pull/127087 __

[clang] [clang-repl] fix error recovery while parsing completely fails (PR #127087)

2025-02-18 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > My theory with limited testing: The crash is caused by assertion failure at > https://github.com/llvm/llvm-project/blob/eb7c947272952d40d3235d89652a10da52cb2b4d/clang/lib/AST/DeclBase.cpp#L1757C1-L1758C54. > So if we disable assertions it does not crash, and crashes otherwise.

[clang] [clang-repl] fix error recovery while parsing completely fails (PR #127087)

2025-02-17 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > There are quite some observations made by @kr-2003 and me here. > > 1. We realize even without this fix, stuff worked perfectly on our Macos ARM > devices. So looks like a Ubuntu issue anyways > > ![image](https://private-user-images.githubusercontent.com/87052487/414089130-66

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 updated https://github.com/llvm/llvm-project/pull/132427 >From 72aafcc255bbcfccb3fa5317e260faf97a3dfed5 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Fri, 21 Mar 2025 20:45:11 +0530 Subject: [PATCH 1/3] [clang][analyzer] Removed warnings for unnamed bitfields --- ...

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 edited https://github.com/llvm/llvm-project/pull/132427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Unnamed fields (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 created https://github.com/llvm/llvm-project/pull/132427 Fixes #132001 Edit ```isNonUnionUninit``` (caller of ```isPrimitiveUninit```): Add a check before calling ```isPrimitiveUninit``` ```cpp if (isPrimitiveType(T)) { if (I->isUnnamedBitField()) { continue;

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 edited https://github.com/llvm/llvm-project/pull/132427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > Could you add a test case that fails before your patch? Sure, here it is ## Testcase ```cpp struct S { S(bool b) : b(b) {} bool b{false}; long long : 7; // padding }; void f() { S s(true); } ``` ### Before Patch https://github.com/user-attachments/asset

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 edited https://github.com/llvm/llvm-project/pull/132427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)

2025-03-21 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 edited https://github.com/llvm/llvm-project/pull/132427 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObjectChecker (PR #132427)

2025-03-26 Thread Abhinav Kumar via cfe-commits
https://github.com/kr-2003 updated https://github.com/llvm/llvm-project/pull/132427 >From 72aafcc255bbcfccb3fa5317e260faf97a3dfed5 Mon Sep 17 00:00:00 2001 From: kr-2003 Date: Fri, 21 Mar 2025 20:45:11 +0530 Subject: [PATCH 1/4] [clang][analyzer] Removed warnings for unnamed bitfields --- ...

[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObjectChecker (PR #132427)

2025-03-26 Thread Abhinav Kumar via cfe-commits
kr-2003 wrote: > > My proposal is to judge the current `FieldDecl` at the beginning of the > > loop, and if it's a UnamedBitField, just skip it, because at that point the > > UnamedBitField's static check should be passing. If it's a NamedBitField > > then it needs to be initialized to pass th