https://bugs.kde.org/show_bug.cgi?id=438249

Igor Kushnir <igor...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |UPSTREAM

--- Comment #32 from Igor Kushnir <igor...@gmail.com> ---
The bug fix just landed. It will be released in LLVM/Clang 17:
https://github.com/llvm/llvm-project/commit/4d55a0b512a17dfaa2461b8803d37b79f6c9691d

Users affected by this bug can ask their distro maintainers to apply the fix to
older LLVM packages. No need to apply the entire patch as it adds new API. The
following reduced diff fixes the crash:

 int clang_getFieldDeclBitWidth(CXCursor C) {
   using namespace cxcursor;

   if (clang_isDeclaration(C.kind)) {
     const Decl *D = getCursorDecl(C);

-    if (const FieldDecl *FD = dyn_cast_or_null<FieldDecl>(D)) {
-      if (FD->isBitField())
-    if (const auto *FD = dyn_cast_or_null<FieldDecl>(D)) {
-      if (FD->isBitField() && !FD->getBitWidth()->isValueDependent())
         return FD->getBitWidthValue(getCursorContext(C));
     }
   }

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to