Issue 139218
Summary [Bazel] `@llvm-project//llvm:Support` fails to build due to incomplete `DelimitedScope`
Labels new issue
Assignees
Reporter hankhsu1996
    When using `@llvm-project//llvm:Support` in a Bazel project, the build fails because `DelimitedScope` is forward-declared in `ScopedPrinter.h` but never defined. This causes `sizeof(DelimitedScope)` to trigger a compilation error when the compiler instantiates `std::unique_ptr<DelimitedScope>`.

Reproduce:

1. Add `@llvm-project//llvm:Support` as a dependency in a `cc_library`.
2. Include `<llvm/Support/Allocator.h>` (which transitively pulls in `ScopedPrinter.h`).
3. Build with Clang or GCC.

Observed error:

```
error: invalid application of 'sizeof' to an incomplete type 'llvm::DelimitedScope'
```

This blocks downstream projects from using `Support` safely.

Suggested fix: either define `DelimitedScope`, or remove it from the public headers until complete.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to