<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Yes, this looks better, please commit.</div><br><div><div>On Apr 2, 2013, at 10:17 , Alexander Kornienko <<a href="mailto:alexfh@google.com">alexfh@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">No, there are no serious reasons for this. I can move it to the main test file for the feature. Please take a look at the patch:<div><br></div><div><div>Index: test/SemaCXX/switch-implicit-fallthrough-regression.cpp</div>
<div>===================================================================</div><div>--- test/SemaCXX/switch-implicit-fallthrough-regression.cpp<span class="" style="white-space:pre">       </span>(revision 178546)</div><div>+++ test/SemaCXX/switch-implicit-fallthrough-regression.cpp<span class="" style="white-space:pre">       </span>(working copy)</div>
<div>@@ -1,17 +0,0 @@</div><div>-// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s</div><div>-</div><div>-void f() {</div><div>-  class C {</div><div>-    void f(int x) {</div><div>-      switch (x) {</div>
<div>-        case 0:</div><div>-          x++;</div><div>-          [[clang::fallthrough]]; // expected-no-diagnostics</div><div>-        case 1:</div><div>-          x++;</div><div>-          break;</div><div>-      }</div>
<div>-    }</div><div>-  };</div><div>-}</div><div>-</div><div>Index: test/SemaCXX/switch-implicit-fallthrough.cpp</div><div>===================================================================</div><div>--- test/SemaCXX/switch-implicit-fallthrough.cpp<span class="" style="white-space:pre">       </span>(revision 178546)</div>
<div>+++ test/SemaCXX/switch-implicit-fallthrough.cpp<span class="" style="white-space:pre">    </span>(working copy)</div><div>@@ -247,3 +247,21 @@</div><div>   }</div><div>   return n;</div><div> }</div><div>+</div><div>+// Fallthrough annotations in local classes used to generate "fallthrough</div>
<div>+// annotation does not directly precede switch label" warning.</div><div>+void fallthrough_in_local_class() {</div><div>+  class C {</div><div>+    void f(int x) {</div><div>+      switch (x) {</div><div>+        case 0:</div>
<div>+          x++;</div><div>+          [[clang::fallthrough]]; // expected-no-diagnostics</div><div>+        case 1:</div><div>+          x++;</div><div>+          break;</div><div>+      }</div><div>+    }</div><div>+  };</div>
<div>+}</div><div>+</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 6:16 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there any reason why this can't go in one of the existing test files? We try not to increase the number of test files at a whim because each one has a nonzero startup time.<br>

<div class="HOEnZb"><div class="h5"><br>
On Apr 2, 2013, at 8:20 , Alexander Kornienko <<a href="mailto:alexfh@google.com">alexfh@google.com</a>> wrote:<br>
<br>
> Author: alexfh<br>
> Date: Tue Apr  2 10:20:32 2013<br>
> New Revision: 178543<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=178543&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=178543&view=rev</a><br>
> Log:<br>
> Fixed "fallthrough annotation does not directly precede switch label" warning in<br>
> case when [[clang::fallthrough]]; is used in a method of a local class.<br>
><br>
> Added:<br>
>    cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp<br>
> Modified:<br>
>    cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp<br>
><br>
> Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=178543&r1=178542&r2=178543&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=178543&r1=178542&r2=178543&view=diff</a><br>

> ==============================================================================<br>
> --- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)<br>
> +++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Tue Apr  2 10:20:32 2013<br>
> @@ -817,6 +817,10 @@ namespace {<br>
>       return true;<br>
>     }<br>
><br>
> +    // We don't want to traverse local type declarations. We analyze their<br>
> +    // methods separately.<br>
> +    bool TraverseDecl(Decl *D) { return true; }<br>
> +<br>
>   private:<br>
><br>
>     static const AttributedStmt *asFallThroughAttr(const Stmt *S) {<br>
><br>
> Added: cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp?rev=178543&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp?rev=178543&view=auto</a><br>

> ==============================================================================<br>
> --- cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp (added)<br>
> +++ cfe/trunk/test/SemaCXX/switch-implicit-fallthrough-regression.cpp Tue Apr  2 10:20:32 2013<br>
> @@ -0,0 +1,17 @@<br>
> +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -Wimplicit-fallthrough %s<br>
> +<br>
> +void f() {<br>
> +  class C {<br>
> +    void f(int x) {<br>
> +      switch (x) {<br>
> +        case 0:<br>
> +          x++;<br>
> +          [[clang::fallthrough]]; // expected-no-diagnostics<br>
> +        case 1:<br>
> +          x++;<br>
> +          break;<br>
> +      }<br>
> +    }<br>
> +  };<br>
> +}<br>
> +<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><font color="#666666"><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(213,15,37);border-right-color:rgb(213,15,37);border-bottom-color:rgb(213,15,37);border-left-color:rgb(213,15,37);padding-top:2px;margin-top:2px">Alexander Kornienko |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(51,105,232);border-right-color:rgb(51,105,232);border-bottom-color:rgb(51,105,232);border-left-color:rgb(51,105,232);padding-top:2px;margin-top:2px"> Software Engineer |</span></font><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(0,153,57);border-right-color:rgb(0,153,57);border-bottom-color:rgb(0,153,57);border-left-color:rgb(0,153,57);padding-top:2px;margin-top:2px"><font color="#666666"> </font><a href="mailto:alexfh@google.com" style="color:rgb(17,85,204)" target="_blank">alexfh@google.com</a> |</span><span style="border-top-width:2px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(238,178,17);border-right-color:rgb(238,178,17);border-bottom-color:rgb(238,178,17);border-left-color:rgb(238,178,17);padding-top:2px;margin-top:2px"> <a value="+35315435283" style="color:rgb(17,85,204)">+49 151 221 77 957</a></span></div>
</div><div><font color="#666666"><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Google Germany GmbH | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">Dienerstr. 12 | </span><span style="background-color:rgb(255,255,255);font-family:Arial,Verdana,sans-serif">80331 München</span></font></div>

</div>
</blockquote></div><br></body></html>