r183952 - Avoid fallthrough in header, to allow external users of Clang libraries to

Richard Smith richard at metafoo.co.uk
Thu Jun 13 15:11:22 PDT 2013


On Thu, Jun 13, 2013 at 3:07 PM, Richard Smith
<richard-llvm at metafoo.co.uk> wrote:
> Author: rsmith
> Date: Thu Jun 13 17:07:02 2013
> New Revision: 183952
>
> URL: http://llvm.org/viewvc/llvm-project?rev=183952&view=rev
> Log:
> Avoid fallthrough in header, to allow external users of Clang libraries to
> build with Clang's -Wimplicit-fallthrough warning enabled. The fallthrough
> was not making this code better.

I forgot to mention in the commit message: patch by Luke Zarko!

> Modified:
>     cfe/trunk/include/clang/Sema/Sema.h
>
> Modified: cfe/trunk/include/clang/Sema/Sema.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=183952&r1=183951&r2=183952&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/Sema.h (original)
> +++ cfe/trunk/include/clang/Sema/Sema.h Thu Jun 13 17:07:02 2013
> @@ -5867,10 +5867,7 @@ public:
>
>        case PriorTemplateArgumentSubstitution:
>        case DefaultTemplateArgumentChecking:
> -        if (X.Template != Y.Template)
> -          return false;
> -
> -        // Fall through
> +        return X.Template == Y.Template && X.TemplateArgs == Y.TemplateArgs;
>
>        case DefaultTemplateArgumentInstantiation:
>        case ExplicitTemplateArgumentSubstitution:
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list