<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61890>61890</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
defining struct/class code and finishing impl later in an export { } block
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ar-visions
</td>
</tr>
</table>
<pre>
```
module;
export module test_mod;
export {
struct test_me {
void test_method();
};
void test_me::test_method() { /// fatal error: cannot export 'test_method' as it is not at namespace scope [?]
printf("test");
}
}
// this works:
module;
export module test_mod;
export struct test_me {
void test_method();
};
void test_me::test_method() { /// works.
printf("test");
}
// this also works:
module;
export module test_mod;
export {
struct test_me {
void test_method();
};
}
void test_me::test_method() { /// works.
printf("test");
}
```
version / target:
clang version 17.0.0 (https://github.com/llvm/llvm-project f66b9fe5876d670b38351c9a7efd90e793f35a30)
Target: arm64-apple-darwin22.3.0
my issue:
...putting it all in export { } works on msvc. its declared exported above and finished inside. what namespace would it be referring to? if the export { } creates the namespace its certainly inside it in the error case?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElc2O4zYMx59GvhBjyFL8dfBhFkGeoPeCluhYXVkyJDnpvH0hJ9nMzLaHBQZdwHBiiyL__FGkMUZzdkQDq7-x-ljglmYfBgwvFxONd7EYvX4bWMPvFz8y_rp4vVli8tvt8Xanv1cfEtzWIFFMfy5e_7sRa-9vYwqbSndrer4HALh4ox8rafaaiY6J_umwPX5y_n4Dk69Mvv60O0cAJk63CyZMaIFC8IHJV1DonE_wECnaD_tbwAgmgYmQrTCBw4XiioogKr8SZIjyxOrjPYk1GJemPbLIrpgQnzP49Od2v4lLs4lw9eF7zMl8DfjfzHvPpvxVOv-BBm30X83nyw_mxyT-X2Ifm_ZCIXc07PwwnCn9wKYsujM8DKq25CUHJro5pXWHu2s5mzRvY6n8wsTJ2svj52UN_i9SCaamGfuJ6q5tdNPyUXayrlSPLU2659T2cpI1Sp4173H_eMgADEtzeMF1tfSiMVyNE6KUJX-fz_IGJsaNfsguy3LdUjLunNsSrQXj4FlIYO3xxg-8gyVeVAlgUgRNymIgfbclDTj6CwE6DZNxJs6kwbhoNJVwnT80-tVvVudwI0GgiULI4ZNn8gRgJkgzfZagAmGiuC89HWUhikJC4-zbPdo-XdzNR55JoDBSnijvKBR6kLqXPRY0VE3HZXuQVVfMQ9XqXh2wIXGoJl6JXo-1rLlqtWr7qsbCDIILyQ-8qjrZya6sDrymqm5lpXpedy07cFrQ2DJXtfThXOy8h6bqel5YHMnG_UMhhKPrvRhC5O9GGPaTMG7nyA7cmpji00syydKgKbN15_sMYuKkLMYIyuv36PdqLqsFi4lCxoE_FXW0Xn0vtmCHXzuhTJx20ZGJ057UPwEAAP__QlMZNA">