[all-commits] [llvm/llvm-project] 4d55a0: Fix include order in CXType.cpp

Collin Baker via All-commits all-commits at lists.llvm.org
Mon Mar 13 07:11:55 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d55a0b512a17dfaa2461b8803d37b79f6c9691d
      https://github.com/llvm/llvm-project/commit/4d55a0b512a17dfaa2461b8803d37b79f6c9691d
  Author: Collin Baker <collinbaker at chromium.org>
  Date:   2023-03-13 (Mon, 13 Mar 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang-c/Index.h
    M clang/tools/libclang/CXType.cpp
    M clang/tools/libclang/libclang.map

  Log Message:
  -----------
  Fix include order in CXType.cpp

Handle template parameter-dependent bit field widths in libclang

In a class template, a bit field's width may depend on a template
parameter. In this case the width expression cannot be evaluated.

Previously clang_getFieldDeclBitWidth() would assert, or cause memory
unsafety and return an invalid result if assertions are disabled.

This adds a check for this case which returns an error code. An
additional function clang_isBitFieldDecl() is added to disambiguate
between error code meanings.

Fixes: https://github.com/llvm/llvm-project/issues/56644
Differential Revision: https://reviews.llvm.org/D130303




More information about the All-commits mailing list