Language Support

The BRiCk program logic is aimed to be a formalization of pragmatic C++. Its feature set is guided by the requirements of low-level program verification and also some pragmatic considerations.

Status

This page describes BRiCk and cpp2v as of October 2026. Each entry links to its tracking issue where one exists. The CHANGES.md file at the repository root lists breaking changes.

A C++ construct that BRiCk does not fully support falls into one of the following categories, from most to least disruptive:

Rejected by cpp2v

cpp2v stops with a fatal error. No part of the translation unit can be verified.

Unsupported declaration

cpp2v emits Dunsupported for a type and continues. Functions whose code needs that type cannot be verified; other functions in the translation unit are unaffected.

Opaque record

cpp2v emits Dopaque for a record whose body it cannot model, keeping its size, alignment, destructor, and operator delete. Code that only passes, stores, or destroys objects of the type can be verified against specifications of its member functions; code that needs the record’s members or bases cannot.

Unsupported syntax

cpp2v emits Eunsupported, Sunsupported, Tunsupported, or Bunsupported. These have no semantics: a proof that reaches one gets stuck.

No semantics

cpp2v translates the construct faithfully, but the program logic has no rule for it. A proof that reaches it gets stuck.

Partial

The program logic covers the construct, but not all of its behaviors, or covers it with a documented restriction.

skylabs.lang.cpp.syntax.supported checks a translation unit for many of these constructs.

Unsupported Features

Feature

Category

Notes

Coroutines, computed goto (goto *p), MSVC inline assembly, SEH (__try)

Rejected by cpp2v

Any statement kind that cpp2v has no printer for is fatal.

Bitfields

Opaque record

A record with a bit-field becomes an opaque boundary (Gopaque): cpp2v keeps its size, alignment, destructor, and operator delete, but not its members or bases. Callers can own such an object through an abstract Rep, pass it by value, and destroy it. Accessing its members, verifying its member functions, anyR, changing its const-ness, and delete are not supported. Records that also have a virtual base, and C records, remain unsupported declarations. BRiCk#307

virtual inheritance (virtual base classes)

Unsupported declaration

This includes standard types built on it, e.g. std::basic_ostream.

Under-aligned fields or base classes (e.g. some [[gnu::packed]] records)

Unsupported declaration

Typed pointers in BRiCk imply natural alignment. Packed records whose fields are all bytes, or whose fields are explicitly aligned, are supported.

Template parameter packs, unresolved concept specializations

Unsupported syntax

Pack arguments and sizeof... are supported.

Variable-length arrays

Unsupported syntax

Their initialization has no semantics. BRiCk#59

Exceptions: throw, try, typeid, dynamic exception specifications

Unsupported syntax

BRiCk additionally assumes that function calls do not throw. BRiCk#15

Lifetime-extended temporaries, e.g. const T& x = f(); or std::initializer_list<int> il = {1, 2, 3};

Unsupported syntax

These require scope-extruded temporaries. BRiCk#272

long double (x87 extended precision), vector types (__vector_size__), block pointers

Unsupported syntax

Unknown cast kinds, non-default calling conventions

Unsupported syntax

goto backward, into a nested statement, or past a declaration (even a vacuously initialized one)

No semantics

Forward goto to a later statement of the same or an enclosing block is supported (Kblock in logic/stmt.v); other jumps reach the function boundary as Goto l, which is False. BRiCk#515

if consteval

No semantics

GCC inline assembly (asm)

No semantics

See Assembly Interoperation for the supported interface to assembly.

Defining variadic functions (va_arg)

No semantics

Calling variadic functions, e.g. printf, is supported.

GNU statement expressions (({ ... }))

No semantics

offsetof

No semantics

Single-field offsetof is translated but has no rule; other forms (nested members, array elements, bases) are unsupported syntax.

dynamic_cast

No semantics

reinterpret_cast

No semantics

BRiCk#156

Member pointer operators (.*, ->*) and calls through member function pointers

No semantics

Member pointer types have a layout, and null member pointers can be created. Default-initializing a member pointer is an error.

Explicitly defaulted constructors and methods that cpp2v does not elaborate

No semantics

Implicit and defaulted members that Clang elaborates are supported.

Initializing members of anonymous structs or unions in a constructor initializer list; indirect or self initialization of unions

No semantics

Destroying operator delete

No semantics

Default arguments of reference type

No semantics

BRiCk#390

Function-local static variables

Partial

The rules for the initialization guard exist, but nothing provides the initial static_initialized ownership, so first use gets stuck.

Changing the active member of a union

Partial

The union_change rule is disabled pending a sound formulation as part of assignment. Implicit union copies translate to an empty body. BRiCk#345

Implicit copy assignment of byte arrays

Partial

Gets stuck at __builtin_memcpy. BRiCk#369

Zero-initialization

Partial

Only trivial cases are supported. BRiCk#135

volatile

Partial

volatile qualifiers are ignored. Default-initialization of a volatile object is unsupported.

switch

Partial

Mixing switch with other control flow (e.g. Duff’s device) is not supported.

Atomics

Partial

All atomic accesses must be sequentially consistent [1]. Compare-exchange is supported on integers, not pointers.

template code

Partial

Templates can only be reasoned about after instantiation to specific arguments.

Translation unit initialization (initialization of globals)

Partial

Not covered by the program logic.

Flexible array members, transparent replacement

Not supported

Flexible array members are not standard C++ but are common in practice.

Floating point arithmetic and comparisons are supported for IEEE-754 formats (half, single, double, and quad precision), with semantics given by Flocq. x87 long double values are abstract.

Soundness Caveats

The following are known ways in which a proof can be weaker than it appears.

  • Exceptions. Function calls are assumed not to throw.

  • Member functions are modeled as functions. Exploiting this requires reinterpret_cast.

  • Defaulted functions. BRiCk relies on the semantics of defaulted functions (default constructors, assignment operators, etc.) as generated by Clang. A different compiler may generate different, still correct, code that invalidates your proof.

Other known soundness bugs, and the pull requests that fix them, carry the soundness label.

Trusted Base

The program logic is stated axiomatically: rocq-skylabs-brick/theories contains about 450 Axiom declarations. The models under theories/lang/cpp/model currently contain 8 Admitted lemmas (simple_pred.v, inductive_pointers.v, inductive_pointers2.v).

Deviations from the Standard

In certain instances, BRiCk’s semantics deviates from the C++ standard.

  • BRiCk’s semantics do not currently permit “pointer zapping”. See Assumptions beyond the standard.

  • BRiCk uses Tnum sz sgn to represent all integer types rather than the standard types char, short, int, long, long long.

  • BRiCk is based on the Clang front-end IR. We believe that this is a reasonable proxy for source-level C++.

  • The BRiCk program logic assumes that the abstract syntax tree is well-typed and uses this assumption to avoid performing type checking within the semantics. If you are using cpp2v to generate the AST, then Clang will ensure that the syntax tree is well typed.

Toolchain Requirements

  • cpp2v requires LLVM 20 through 22 (as tested in CI). The release images use LLVM 22.

  • Generate the AST with exactly the same Clang flags and target as your build. The AST fixes implementation-defined behavior, such as the sizes of integer types (whether incrementing a long holding 0x7fffffff overflows), and the code Clang generates for defaulted functions.

Extensions to the Standard

BRiCk also extends the C++ standard in limited ways to make low-level program verification possible. For example, inter-operation with assembly (see Assembly Interoperation), sharing data across address spaces, etc. We believe that our extensions are conservative and characterize the way that low-level programmers rely on compilers to work.