r263155 - Add test for r263138.

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 10 13:37:56 PST 2016


Thank you!

On Thu, Mar 10, 2016 at 2:22 PM, Richard Smith via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: rsmith
> Date: Thu Mar 10 13:22:21 2016
> New Revision: 263155
>
> URL: http://llvm.org/viewvc/llvm-project?rev=263155&view=rev
> Log:
> Add test for r263138.
>
> Added:
>     cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp
>
> Added:
> cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp?rev=263155&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp
> (added)
> +++ cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-off-by-default.cpp
> Thu Mar 10 13:22:21 2016
> @@ -0,0 +1,13 @@
> +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -DUNREACHABLE=1 %s
> +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -DUNREACHABLE=0
> -Wimplicit-fallthrough %s
> +
> +void fallthrough(int n) {
> +  switch (n) {
> +  case 1:
> +    if (UNREACHABLE)
> +      return;
> +    [[fallthrough]]; // expected-no-diagnostics, only checked when
> UNREACHABLE=0
> +  case 2:
> +    break;
> +  }
> +}
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160310/b2dd8ed4/attachment.html>


More information about the cfe-commits mailing list