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 cpp2vstops with a fatal error. No part of the translation unit can be verified.- Unsupported declaration
cpp2vemitsDunsupportedfor a type and continues. Functions whose code needs that type cannot be verified; other functions in the translation unit are unaffected.- Opaque record
cpp2vemitsDopaquefor a record whose body it cannot model, keeping its size, alignment, destructor, andoperator 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
cpp2vemitsEunsupported,Sunsupported,Tunsupported, orBunsupported. These have no semantics: a proof that reaches one gets stuck.- No semantics
cpp2vtranslates 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 |
Rejected by |
Any statement kind that |
Bitfields |
Opaque record |
A record with a bit-field becomes an opaque boundary ( |
|
Unsupported declaration |
This includes standard types built on it, e.g. |
Under-aligned fields or base classes (e.g. some |
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 |
Variable-length arrays |
Unsupported syntax |
Their initialization has no semantics. BRiCk#59 |
Exceptions: |
Unsupported syntax |
BRiCk additionally assumes that function calls do not throw. BRiCk#15 |
Lifetime-extended temporaries, e.g. |
Unsupported syntax |
These require scope-extruded temporaries. BRiCk#272 |
|
Unsupported syntax |
|
Unknown cast kinds, non-default calling conventions |
Unsupported syntax |
|
|
No semantics |
Forward |
|
No semantics |
|
GCC inline assembly ( |
No semantics |
See Assembly Interoperation for the supported interface to assembly. |
Defining variadic functions ( |
No semantics |
Calling variadic functions, e.g. |
GNU statement expressions ( |
No semantics |
|
|
No semantics |
Single-field |
|
No semantics |
|
|
No semantics |
|
Member pointer operators ( |
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 |
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 |
No semantics |
|
Default arguments of reference type |
No semantics |
|
Function-local |
Partial |
The rules for the initialization guard exist, but nothing provides the
initial |
Changing the active member of a |
Partial |
The |
Implicit copy assignment of byte arrays |
Partial |
Gets stuck at |
Zero-initialization |
Partial |
Only trivial cases are supported. BRiCk#135 |
|
Partial |
|
|
Partial |
Mixing |
Atomics |
Partial |
All atomic accesses must be sequentially consistent [1]. Compare-exchange is supported on integers, not pointers. |
|
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 sgnto represent all integer types rather than the standard typeschar,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
cpp2vto generate the AST, then Clang will ensure that the syntax tree is well typed.
Toolchain Requirements
cpp2vrequires 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
longholding0x7fffffffoverflows), 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.