silence warning about missing return and add assert to isError#3079
silence warning about missing return and add assert to isError#3079yebblies merged 1 commit intodlang:masterfrom
Conversation
add assert to isError
|
Auto-merge toggled on |
silence warning about missing return and add assert to isError
There was a problem hiding this comment.
I'd rather we used a function similar to llvm_unreachable which is easy to mark up as __attribute__((noreturn))/__declspec(noreturn).
There was a problem hiding this comment.
I'd rather we didn't add stuff that doesn't have a translation to D.
There was a problem hiding this comment.
assert(0, msg) seems like a good D translation of that, because the semantics are actually part of the language there. (Well, actually llvm_unreachable doesn't compile to a trap in release mode, just to the respective equivalent of __builtin_unreachable but that's was not my point here. Anyway, it's a rather minor issue…)
There was a problem hiding this comment.
There is already an assert(0) here.
There was a problem hiding this comment.
Hmm never mind. Still, I'd rather not put and more clang/gcc/msvc extensions into the dmd source, eg I had to special case the noreturn attributes on fatal. We're abandoning C++ after all.
tiny followup for #3074