
5 Apr
2012
5 Apr
'12
11:58 a.m.
On 04/03/2012 10:26 PM, Pyry Jahkola wrote:
Yep, same thing on clang: as soon as I enable noexcept in the RETURNS(...) macro, it gives "error: invalid use of 'this' outside of a nonstatic member function".
// ****** workaround ****** static mul_ get() noexcept { return mul_(); }
I'm not sure which one is correct here, GCC or Clang, but but this trick had a similar result: "error: calling 'get' with incomplete return type 'mul_'".
The only alternative way I could fix it was to define a function returning a reference
Could it be that the compiler forces instantiation of the code inside noexcept, like earlier MSVC versions did with decltype? Not sure what the standard says about this.