Hi, Akim — On Jan 19, 2019, at 11:49 PM, Akim Demaille <a...@lrde.epita.fr> wrote: > > Hi Derek! > >> Le 19 janv. 2019 à 20:47, Derek Clegg <de...@me.com> a écrit : >> >> I ran into just one issue: >> >> aux/parser-internal.h:429:12: error: 'syntax_error' has no out-of-line >> virtual >> method definitions; its vtable will be emitted in every translation unit >> [-Werror,-Wweak-vtables] >> struct syntax_error : std::runtime_error >> ^ >> 1 error generated. > > I don't think I will address this warning, the cure is way worse than the > problem. > > To add the destructor, I must make the signature explicit, and it cannot be > different from the one in the base class, so I must add noexcept: > > ~syntax_error () YY_NOEXCEPT;
In C++98 the signature is virtual ~exception() throw(); and in C++11 the signature is virtual ~exception(); so this only has to be handled specially for C++98. Wouldn’t it be sufficient to explicitly write #if 201103L <= YY_CPLUSPLUS ~syntax_error(); #else ~syntax_error() throw(); #endif and similarly for the definition? It seems problematic to redefine YY_NOEXCEPT, especially since “noexcept” and “throw()” aren’t used equivalently. Derek