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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #15 from Patrick Palka <ppalka at gcc dot gnu.org> ---
The comment #5 testcase now works on trunk, but the comment #4 testcase still
fails to link.  Reduced:

$ cat 99377_a.H 
template<typename>
struct Widget
{
  Widget (int) { }

  bool First() const { return true; }

  bool Second () const { return true;}
};

inline void Frob (const Widget<int>& w) noexcept
{
  w.First ();
}

$ 99377_b.C 
export module Foo:check;
import "99377_a.H";

export inline bool Check (const Widget<int>& w)
{
  return w.Second ();
}

$ cat 99377_c.C 
export module Foo;
export import :check;

$ cat 99377_d.C 
import Foo;

int main ()
{
  return Check (0) ? 0 : 1;
}

$ g++ -fmodules-ts 99377_a.H 99377_b.C 99377_c.C 99377_d.C
/usr/bin/ld: /tmp/ccBHt33S.o: in function `Check@Foo(Widget<int> const&)':
99377_d.C:(.text._ZW3Foo5CheckRK6WidgetIiE[_ZW3Foo5CheckRK6WidgetIiE]+0x14):
undefined reference to `Widget<int>::Second() const'

Reply via email to