Closed lzhangzz closed 2 years ago
No it's almost certainly a parse bug in clang only, as it works fine in GCC or MSVC.
It seems to depend on where in the file the throw
is. See https://godbolt.org/z/xcjehPaec.
It doesn't occur if the throw doesn't mention its base class. See https://godbolt.org/z/soYKMW5Pr
At least you now have a workaround: define your throw exception method a little later after anything which affects SFINAE.
Incidentally, I've seen this parse ordering bug and throw in clang before, though not in this context. It affects every version of clang from the beginning until the most recent. One should really make them a contained repro, though clang is now the worst for timely fixes of compiler bugs of the three major compilers.
I'm going to close this as I think this a compiler bug. Hope the workaround works for you.
I'm getting really weird compile error when constructing
system_error2::error
from enums through multiple implicit conversions, well it's best explained in code:https://godbolt.org/z/aEqKbxK6c
The
throw
in the inlined_do_throw_exception
caused the problem, if it's removed or moved into some implementation file, the problem is gone. Is this somehow related to some exception specifications somewhere?