<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/61601>61601</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Non-exported definitions in C++ module interface partitions can conflict
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          rnikander
      </td>
    </tr>
</table>

<pre>
    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
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVcGO2zYQ_RrqMpAgkZK9PujgWBEaFNsGSA--UtTIYpciCZLa7P59QUmxN07bBIlBmPIMPe-94Rubey8vGrEm1TtSNQmfw2hc7bR84rpHl3Smf60_eAij9MChmy-EtSRvSH7c3nf5o-kzIcguv0bWJQh9F9cSxRdrXIDJ9LNC-GvER9MT9nVSTstG2PEjd6H4_zS9pq-Ad7yWIj_L7I6CDzxIAVIHUMZcgLAGih9iQH-JwU3lfzXn35h9pzfvnTMO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