r198804 - Silencing an MSVC warning about control reaching the end of a non-void function.

dblaikie at gmail.com dblaikie at gmail.com
Thu Jan 9 16:05:49 PST 2014


On Wed Jan 08 2014 at 3:15:44 PM, Aaron Ballman <aaron at aaronballman.com>
wrote:

> Author: aaronballman
> Date: Wed Jan  8 17:08:41 2014
> New Revision: 198804
>
> URL: http://llvm.org/viewvc/llvm-project?rev=198804&view=rev
> Log:
> Silencing an MSVC warning about control reaching the end of a non-void
> function.
>
> Modified:
>     cfe/trunk/include/clang/Parse/Parser.h
>
> Modified: cfe/trunk/include/clang/Parse/Parser.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/
> clang/Parse/Parser.h?rev=198804&r1=198803&r2=198804&view=diff
> ============================================================
> ==================
> --- cfe/trunk/include/clang/Parse/Parser.h (original)
> +++ cfe/trunk/include/clang/Parse/Parser.h Wed Jan  8 17:08:41 2014
> @@ -1654,6 +1654,8 @@ private:
>    /// trailing-type-specifier)?
>    static bool isTypeSpecifier(DeclSpecContext DSC) {
>      switch (DSC) {
> +    default:
> +      llvm_unreachable("Missing DeclSpecContext case");
>

Weird - does this not trigger Clang's -Wcovered-switch-default? (or the
code prior to your patch should've triggered -Wswitch?)

Usually we suppress these problems for other compilers by putting the
unreachable after the switch.


>      case DSC_normal:
>      case DSC_class:
>      case DSC_top_level:
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140110/fbb02799/attachment.html>


More information about the cfe-commits mailing list