# LLVM ERROR: Invalid size request on a scalable vector

**URL:** <https://community.sonarsource.com/t/llvm-error-invalid-size-request-on-a-scalable-vector/190735>\
**Category:** SonarQube Server / Community Build\
**Tags:** cfamily\
**Created:** [October 30, 2026, 7:10am UTC](https://community.sonarsource.com/t/llvm-error-invalid-size-request-on-a-scalable-vector/190735 "2026-10-30T07:10:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinh2011](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/martinh2011/32/29596_2.png) [@martinh2011](https://community.sonarsource.com/u/martinh2011)\
**Post date:** [October 30, 2026, 7:10am UTC](https://community.sonarsource.com/t/llvm-error-invalid-size-request-on-a-scalable-vector/190735/1 "2026-10-30T07:10:41Z")

</div>

We currently see the “LLVM ERROR: Invalid size request on a scalable vector” error which has been reported before.

SonarQube Server: Enterprise Edition v2026.5.3 (133540)

CFamily plugin 6.85.0.102562 (also happened with the 6.77 → 6.85 upgrade, first seen when C/C++ taint analysis became active)

Visual Studio 2026 (MSVC 14.51), x64, compile via build-wrapper. Affects about54 of ca. 741 translation units in a large project. The regular analysis completes, only taint IR generation fails for those TUs.

I tried to isolate the code/circumstances where this happens. What we could find:

- Trigger seems to be: Reading a non-enum field of a struct that has a member whose enum type is declared in the project’s precompiled header (stdafx.h, /Yu):

```cpp
// in the PCH: enum E { A, B };
struct S { E e; int i; };

```

```cpp
int f(const S& s) { return s.i; } // IR generation fails
// return static_cast(s.e); // passes

```

This happens for plain, namespaced and enum class enums, any field order. It passes if the same enum is declared after the PCH, or if the TU is compiled without PCH. We could not reproduce it in a standalone project, nor with a separate PCH with identical content, nor with a PCH shared by more than 30 TUs. It seems to depend on how the analyzer handles one particular PCH in a large project.

Unfortunately I cannot share a reproducer here publicly. Maybe privately. Let me know.

---

<div class="post-metadata">

**Author:** ![mark.dewever](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@mark.dewever](https://community.sonarsource.com/u/mark.dewever)\
**Post date:** [October 30, 2026, 7:18am UTC](https://community.sonarsource.com/t/llvm-error-invalid-size-request-on-a-scalable-vector/190735/3 "2026-10-30T07:18:49Z")

</div>

I’ve just send you a PM.

---

<div class="post-metadata">

**Author:** ![mark.dewever](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@mark.dewever](https://community.sonarsource.com/u/mark.dewever)\
**Post date:** [October 30, 2026, 12:42pm UTC](https://community.sonarsource.com/t/llvm-error-invalid-size-request-on-a-scalable-vector/190735/4 "2026-10-30T12:42:31Z")

</div>

Thanks for sharing your reproducer. I’ve verified your reproducer and your issue is the same as [C/C++ taint analysis: LLVM IR generation fails with "Invalid size request on a scalable vector" (Win](https://community.sonarsource.com/t/c-c-taint-analysis-llvm-ir-generation-fails-with-invalid-size-request-on-a-scalable-vector-win/190312)

We expect to have a fix in the next release of CFamily plugin.
