[clang] [llvm] Non constant size and offset in DWARF (PR #141106)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 10:58:41 PDT 2025


================
@@ -1301,4 +1301,33 @@ TEST(DIBuilder, CompositeTypes) {
   EXPECT_EQ(Enum->getTag(), dwarf::DW_TAG_enumeration_type);
 }
 
+TEST(DIBuilder, DynamicOffsetAndSize) {
+  LLVMContext Ctx;
+  std::unique_ptr<Module> M(new Module("MyModule", Ctx));
----------------
dwblaikie wrote:

Prefer `std::make_unique` and optionally omit the type on the LHS since it'll be clear from the RHS, like this:
```
auto M = std::make_unique<Module>("MyModule", Ctx);
```

https://github.com/llvm/llvm-project/pull/141106


More information about the cfe-commits mailing list