https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124928
--- Comment #3 from d7d1cd <d7d1cd at mail dot ru> ---
Minimal example:
$ cat foo.h
#pragma once
class Foo {};
$ cat foo.ixx
module;
#include "foo.h"
export module M : foo;
export using ::Foo;
$ cat bar.h
#pragma once
#include "foo.h"
struct Bar {
Foo f;
};
$ cat bar.ixx
module;
#include "bar.h"
export module M : bar;
export using ::Bar;
$ cat module.ixx
export module M;
export import : bar;
export import : foo;
$ cat main.cc
import M;
int main() {
Foo f;
}
Compilation and error:
$ g++ -std=c++23 -fmodules foo.ixx bar.ixx module.ixx main.cc
main.cc: In function ‘int main()’:
main.cc:5:5: error: ‘Foo’ was not declared in this scope
5 | Foo f;
| ^~~