Re: static inline giving multiple definition errors with "unity" builds

2020-10-05 Thread Nathan Sidwell
On 10/4/20 1:10 PM, Paul Smith wrote: On Sun, 2020-10-04 at 03:36 -0400, Paul Smith wrote: I have a templated class C that required its type T to have operator bool() defined in order to work properly. Never mind, I think there was some local error where things were not being recompiled when t

Re: static inline giving multiple definition errors with "unity" builds

2020-10-04 Thread Paul Smith
On Sun, 2020-10-04 at 03:36 -0400, Paul Smith wrote: > I have a templated class C that required its type T to have operator > bool() defined in order to work properly. Never mind, I think there was some local error where things were not being recompiled when they should be. I don't know why that

Re: static inline giving multiple definition errors with "unity" builds

2020-10-04 Thread Paul Smith
On Sun, 2020-10-04 at 03:36 -0400, Paul Smith wrote: > But!! When I nm the individual cxx.o files none of these operator > symbols appear, at all! As you might have expected, this turns out to be wrong: the symbols were just in a set of object files that I did not expect. I'll see if there's an

Re: static inline giving multiple definition errors with "unity" builds

2020-10-04 Thread Paul Smith
On Sun, 2020-10-04 at 03:36 -0400, Paul Smith wrote: > I made it static inline like this: > > static inline bool operator!(T t) { return t != T::EMPTY; } Obviously in my real code I used t == T::EMPTY here... :-/

static inline giving multiple definition errors with "unity" builds

2020-10-04 Thread Paul Smith
I'm using GCC 8.1.0 / binutils 2.30 (I plan to upgrade to latest stuff in the next few weeks or so...), on GNU/Linux Intel 64bit. I have a templated class C that required its type T to have operator bool() defined in order to work properly. I want to use that with a enum class so clearly that doe