This patch adds a possibility to use an external layout for bit fields.
The problem occurred while debugging a Windows application with PDB symbols. The structure was as follows:
struct S { short a : 3; short : 8; short b : 5; }
The problem is that PDB doesn't have information about the unnamed bit field, so the field b was located just behind the field a. But PDB has a valid information about fields offsets, so we can use it to solve the problem.
Another relevant test:
Because we don't do vfptr layout adjustments when using an external layout source, I think this would have put x at offset 0 instead of at offset 8 prior to your patch.