Re: [cfe-users] Linking problem with implicit instantiation of constructor/destructor

2020-04-19 Thread Jaroslav Zeman via cfe-users
> 
> What happens if you change the order of the .cpp files, putting
> template.cpp first; is it stil unresolved?
> 
> clang++ -o test template.cpp main.cpp

The order doesn't matter.

> I don't believe this code is valid according to C++. I believe it would
> require an explicit instantiation of the ctor/dtor somewhere to make that
> code valid - though I don't have chapter and verse on the spec at hand just
> now to back that up.

I tried to read the c++ specs, but didn't find anything, that would clearly 
state, if this is correct or incorrect. But the specs are too complicated for 
me to understand.

My opinion is that it is bad to rely on implicit instantiation to happen 
somewhere and don't do the explicit one. So I've already fixed all these 
problems in our code and now I am just curious, what others think about it.

JZ.



___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


Re: [cfe-users] Linking problem with implicit instantiation of constructor/destructor

2020-04-19 Thread David Blaikie via cfe-users
Yeah, can't seem to divine the concrete wording here either - perhaps
Richard will have a moment to chime in.

On Sun, Apr 19, 2020 at 6:10 AM Jaroslav Zeman via cfe-users <
cfe-users@lists.llvm.org> wrote:

> >
> > What happens if you change the order of the .cpp files, putting
> > template.cpp first; is it stil unresolved?
> >
> > clang++ -o test template.cpp main.cpp
>
> The order doesn't matter.
>
> > I don't believe this code is valid according to C++. I believe it would
> > require an explicit instantiation of the ctor/dtor somewhere to make that
> > code valid - though I don't have chapter and verse on the spec at hand
> just
> > now to back that up.
>
> I tried to read the c++ specs, but didn't find anything, that would
> clearly
> state, if this is correct or incorrect. But the specs are too complicated
> for
> me to understand.
>
> My opinion is that it is bad to rely on implicit instantiation to happen
> somewhere and don't do the explicit one. So I've already fixed all these
> problems in our code and now I am just curious, what others think about it.
>
> JZ.
>
>
>
> ___
> cfe-users mailing list
> cfe-users@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users