[PATCH v2] tst-unique4.cc: Add explicit instantiation declaration S<N>::i

H.J. Lu hjl.tools@gmail.com
Mon Dec 30 20:49:47 GMT 2024


On Mon, Dec 30, 2024 at 6:39 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> > Clang 19 complains:
> > tst-unique4.cc:7:16: error: expected unqualified-id
> >     7 | extern template<> int S<1>;
> >       |                ^
> > 1 error generated.
>
> I should habe looked up the syntax.  It's this:
>
> extern template class S<1>;

tst-unique4.cc:7:17: error: class template 'S' was previously declared
as a struct template; this is valid, but may result in linker errors
under the Microsoft C++ ABI [-Werror,-Wmismatched-tags]
    7 | extern template class S<1>;
      |                 ^
./tst-unique4.h:3:8: note: previous use is here
    3 | struct S
      |        ^
tst-unique4.cc:7:17: note: did you mean struct here?
    7 | extern template class S<1>;
      |                 ^~~~~
      |                 struct
1 error generated.

>
> And without the extern in the DSO, to create the definition.
>
> Please check that the relocations in the main program do not change
> significantly as a result of these changes.
>
> Thanks,
> Florian
>


-- 
H.J.


More information about the Libc-alpha mailing list