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

    <tr>
        <th>Summary</th>
        <td>
            Structures that were not declared as "export" were abnormally exported
        </td>
    </tr>

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

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

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

<pre>
    /// bp.cppm
```
module;
#include <memory>
#include <vector>
export module bp;

struct Layer {  
    void forward(int) {  }
};

export class BP {
 std::vector<std::shared_ptr<Layer>> layers_;
};
```

/// cnn.cppm
```
module;
#include <memory>
#include <vector>
export module cnn;

import bp;

struct Layer { 
    void forward() { }
};

export
class CNN {
    std::vector<std::shared_ptr<Layer>> layouts_;
};
```

command:
```
clang++ -std=c++20 --precompile bp.cppm -o bp.pcm
clang++ -std=c++20 --precompile cnn.cppm -o cnn.pcm -fprebuilt-module-path=.
```

error message:
```
cnn.cppm:8:8: error: declaration 'Layer' attached to named module 'cnn' cannot be attached to other modules
    8 | struct Layer { 
      | ^
/home/hexne/Projects/modforge/bp.cppm:6:8: note: also found
    6 | struct Layer {  
      | ^
/home/hexne/Projects/modforge/bp.cppm:7:10: error: 'Layer::forward' from module 'bp' is not present in definition of 'Layer' provided earlier
    7 | void forward(int) {  }
      |          ^
cnn.cppm:9:10: note: declaration of 'forward' does not match
    9 |     void forward() {  }
 |          ^
2 errors generated.

```


</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VcuO4jgU_RqzuQIFGwgssghFsxq1WpoPaDn2DfHIj8h2qK6_H9l5NKirpjSjaRQU4_s8x4drHoK6WcSK7M9kf1nxIXbOVx3-sLhqnHyrCL2ODzT9RvS9IUVNDsX0FLVxctBI2DntU6as0INEIOzFoHH-jbAvv1juKKLzowV_9M5HGNNA00-ZijpEP4gIf_A39EDKMwApagCAu1MSWudfuZeEHpWNhJ4mj_KSgsvLkmVKLzQPAc7fkltKE6IkrCasnlt5WXZCxz3K731Mu7l6apR9AZ3W4fuUeqnxwEUGOtMlrP39fAlrF6jKZMs_Ufg-gzN9H7FHinrk7-Xr15lAgP_KoRviZyQKZwy3OdezTWhub4SeCT3DOle7iPEnLWC97j0KZ3qVhZTJh7VLy16YfxU9n10KT-teGFi3vcdmUDquR_LXPY8dYZfNrwDQe-fBYAj8hu_AmKXB6uP0hRySFhKF5p5H5SwQWo7s0RJ4jFx0KCE6sNygnDVAaJlkQEsQ3FoXocEnZxc79JNzmM7uCKR8gY_0AdlK9qMSr50zmF5pKBB6_ebdXyhiIPRqnGydv6XdeTqw-jBDsi4m8MB1cNC6wcop_-H96v9P-ZKwels8UbrQmMW5CL-E1jvzQGPTp00VUufQewxoIygLEltlVT4R1z4dSu_dXUmUgNxrhX5CUGYEnw6qn2CXz4j6QSCnBc5M56NAxnYeEEmHY_uGR9FNNU5LjQ_--XM_77RCRxoD3NCi5xHlZpp0z5JfyYrJEzvxFVbbcnc67A-7olx1VbtnVFI8USab7bHkzVHKLTLBJWXt_nRcqYoWdF8cttvtflcUh01zPFEh6ZaWQmCJLdkVaLjSG63vZuP8baVCGLDa7ljJdivNG9Qh32CUWnyFbCWUpgvNVylo3Qy3QHaFViGGn2miihqrP7MOB48BYscjvKLHTOFINErgAQil0zCkdPTgjXXecK3fYLSgXA1eV12MfUhKy9fATcVuaDbCGUKvqfD0WvejjAm95naTnCc894r-HQAA__8rsEEe">