<div dir="ltr">Hi Jonas,<div><br></div><div>this new test is failing on Green Dragon:</div><div><a href="http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/39223/consoleFull#11207350448254eaf0-7326-4999-85b0-388101f2d404">http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/39223/consoleFull#11207350448254eaf0-7326-4999-85b0-388101f2d404</a><br></div><div><br></div><div>Could you please take a look?</div><div><br></div><div>Thanks</div><div><br></div><div>Cheers,</div><div>Juergen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 3, 2017 at 9:25 AM, Jonas Toth via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jonastoth<br>
Date: Tue Oct  3 09:25:01 2017<br>
New Revision: 314808<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=314808&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=314808&view=rev</a><br>
Log:<br>
[clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise<br>
<br>
The bug happened with stream operations, that were not recognized in all cases.<br>
Even there were already existing test for streaming classes, they did not catch this bug.<br>
Adding the isolated example to the existing tests did not trigger the bug.<br>
Therefore i created a new isolated file that did expose the bug indeed.<br>
<br>
Differential: <a href="https://reviews.llvm.org/D38399" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D38399</a><br>
reviewed by aaron.ballman<br>
<br>
Added:<br>
    clang-tools-extra/trunk/test/<wbr>clang-tidy/hicpp-signed-<wbr>bitwise-bug34747.cpp<br>
Modified:<br>
    clang-tools-extra/trunk/clang-<wbr>tidy/hicpp/SignedBitwiseCheck.<wbr>cpp<br>
<br>
Modified: clang-tools-extra/trunk/clang-<wbr>tidy/hicpp/SignedBitwiseCheck.<wbr>cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp?rev=314808&r1=314807&r2=314808&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/clang-tidy/hicpp/<wbr>SignedBitwiseCheck.cpp?rev=<wbr>314808&r1=314807&r2=314808&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/clang-<wbr>tidy/hicpp/SignedBitwiseCheck.<wbr>cpp (original)<br>
+++ clang-tools-extra/trunk/clang-<wbr>tidy/hicpp/SignedBitwiseCheck.<wbr>cpp Tue Oct  3 09:25:01 2017<br>
@@ -27,7 +27,9 @@ void SignedBitwiseCheck::<wbr>registerMatcher<br>
       binaryOperator(allOf(anyOf(<wbr>hasOperatorName("|"), hasOperatorName("&"),<br>
                                  hasOperatorName("^"), hasOperatorName("<<"),<br>
                                  hasOperatorName(">>")),<br>
-                           hasEitherOperand(<wbr>SignedIntegerOperand)))<br>
+                           hasEitherOperand(<wbr>SignedIntegerOperand),<br>
+                           hasLHS(hasType(isInteger())),<br>
+                           hasRHS(hasType(isInteger()))))<br>
           .bind("binary_signed"),<br>
       this);<br>
<br>
<br>
Added: clang-tools-extra/trunk/test/<wbr>clang-tidy/hicpp-signed-<wbr>bitwise-bug34747.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp?rev=314808&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/clang-tools-extra/<wbr>trunk/test/clang-tidy/hicpp-<wbr>signed-bitwise-bug34747.cpp?<wbr>rev=314808&view=auto</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- clang-tools-extra/trunk/test/<wbr>clang-tidy/hicpp-signed-<wbr>bitwise-bug34747.cpp (added)<br>
+++ clang-tools-extra/trunk/test/<wbr>clang-tidy/hicpp-signed-<wbr>bitwise-bug34747.cpp Tue Oct  3 09:25:01 2017<br>
@@ -0,0 +1,21 @@<br>
+// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 | count 0<br>
+<br>
+// Note: this test expects no diagnostics, but FileCheck cannot handle that,<br>
+// hence the use of | count 0.<br>
+<br>
+template <typename C><br>
+struct OutputStream {<br>
+  OutputStream &operator<<(C);<br>
+};<br>
+<br>
+template <typename C><br>
+struct foo {<br>
+  typedef OutputStream<C> stream_type;<br>
+  foo(stream_type &o) {<br>
+    o << 'x'; // warning occured here, fixed now<br>
+  }<br>
+};<br>
+<br>
+void bar(OutputStream<signed char> &o) {<br>
+  foo<signed char> f(o);<br>
+}<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>