https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114990

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to cqwrteur from comment #9)
> (In reply to Jason Merrill from comment #8)
> > bar.cppm:4:20: error: conflicting declaration of ‘void foo()’ in module 
> > ‘bar’
> >     4 | export inline void foo() noexcept;
> >       |                    ^~~
> > In file included from bar.cppm:2:
> > someheader.hpp:1:13: note: previously declared in global module
> 
> That is my problem. This just breaks header only libraries right?

No, you just need to #include the library header before the "export module"
line.  Or better yet, use import <header> instead of #include.

> This is the same.
> 
> import std;
> #include<aheaderonlylibrary> //it uses std features.
> 
> This is absolutely the standard bug.

This is a GCC bug, as described in comment #1.  If you

import <aheaderonlylibrary>;

instead, it should work fine.  Naturally, that requires that you first

g++ -fmodules-ts -c -x c++-system-header aheaderonlylibrary

Reply via email to