[libcxx-commits] [PATCH] D133262: [clang] Fixes how we represent / emulate builtin templates
Matheus Izvekov via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Sep 7 15:52:14 PDT 2022
mizvekov marked an inline comment as done.
mizvekov added inline comments.
================
Comment at: clang/lib/AST/DeclTemplate.cpp:262
+ }
+ default:;
+ };
----------------
mizvekov wrote:
> erichkeane wrote:
> > The semicolon after default is bizarre/unnecessary. That said, I'd suggest just making the 'default' case be 'return false'.
> This is just a workaround for some versions of GCC and/or MSVC which warn on control flow reaching the end of the function, even in cases such as a switch which returns in all paths.
> Also we prefer to emit a warning on unhandled cases when omitting the default case.
>
> So this is a compact way of avoiding those issues without having to add a `llvm_unreachable("control flow should never get here");` at the end.
>
> Have we gotten rid of the old versions of those toolchains which had this problem?
Removed as I just confirmed we don't need it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133262/new/
https://reviews.llvm.org/D133262
More information about the libcxx-commits
mailing list