| Issue |
61601
|
| Summary |
Non-exported definitions in C++ module interface partitions can conflict
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
rnikander
|
Is this a bug?
`Mod.cc`
```c++
export module TheMod;
export import :Part1;
export import :Part2;
```
`Part1.cc`
```c++
export module TheMod:Part1;
static int loog = 1;
```
`Part2.cc`
```c++
export module TheMod:Part2;
import :Part1;
static int loog = 2;
```
Error from Clang:
```text
Part2.cc:6:12: error: redefinition of 'loog'
static int loog = 2;
^
Part1.cc:4:12: note: previous definition is here
static int loog = 1;
```
Here is a simple build script to reproduce the error with the Clang I have currently (on macOS). I real life I run these experiments as part of a large CMake project, but this minimal script causes the same error:
`build.sh`
```sh
CXX="/Dev/llvm-project/build/bin/clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -std=c++2b"
set -e
$CXX -fprebuilt-module-path=. -x c++-module Part1.cc --precompile -o TheMod-Part1.pcm
$CXX -fprebuilt-module-path=. -x c++-module Part2.cc --precompile -o TheMod-Part2.pcm
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs