Re: [clang-tools-extra] r314808 - [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise

2017-10-03 Thread Juergen Ributzka via cfe-commits
Great! Thanks Jonas

> On Oct 3, 2017, at 10:54 AM, Jonas Toth  wrote:
> 
> Hi Juergen,
> 
> i did already work on fixing the issue I introduced with the commits. I am 
> currently waiting for the buildbot to catch up with the committed fix.
> 
> As far as i can see, the newer commits did actually fix (at least chapunis 
> buildbot did go green again), but i have my eye on it.
> 
> Cheers, Jonas
> 
> Am 03.10.2017 um 19:53 schrieb Juergen Ributzka:
>> Hi Jonas,
>> 
>> this new test is failing on Green Dragon:
>> http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/39223/consoleFull#11207350448254eaf0-7326-4999-85b0-388101f2d404
>>  
>> 
>> 
>> Could you please take a look?
>> 
>> Thanks
>> 
>> Cheers,
>> Juergen
>> 
>> On Tue, Oct 3, 2017 at 9:25 AM, Jonas Toth via cfe-commits 
>> > wrote:
>> Author: jonastoth
>> Date: Tue Oct  3 09:25:01 2017
>> New Revision: 314808
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=314808=rev 
>> 
>> Log:
>> [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise
>> 
>> The bug happened with stream operations, that were not recognized in all 
>> cases.
>> Even there were already existing test for streaming classes, they did not 
>> catch this bug.
>> Adding the isolated example to the existing tests did not trigger the bug.
>> Therefore i created a new isolated file that did expose the bug indeed.
>> 
>> Differential: https://reviews.llvm.org/D38399 
>> 
>> reviewed by aaron.ballman
>> 
>> Added:
>> clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
>> Modified:
>> clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
>> 
>> Modified: clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp?rev=314808=314807=314808=diff
>>  
>> 
>> ==
>> --- clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp 
>> (original)
>> +++ clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp Tue Oct  
>> 3 09:25:01 2017
>> @@ -27,7 +27,9 @@ void SignedBitwiseCheck::registerMatcher
>>binaryOperator(allOf(anyOf(hasOperatorName("|"), hasOperatorName("&"),
>>   hasOperatorName("^"), 
>> hasOperatorName("<<"),
>>   hasOperatorName(">>")),
>> -   hasEitherOperand(SignedIntegerOperand)))
>> +   hasEitherOperand(SignedIntegerOperand),
>> +   hasLHS(hasType(isInteger())),
>> +   hasRHS(hasType(isInteger()
>>.bind("binary_signed"),
>>this);
>> 
>> 
>> Added: 
>> clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp?rev=314808=auto
>>  
>> 
>> ==
>> --- 
>> clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp 
>> (added)
>> +++ 
>> clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp 
>> Tue Oct  3 09:25:01 2017
>> @@ -0,0 +1,21 @@
>> +// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 | 
>> count 0
>> +
>> +// Note: this test expects no diagnostics, but FileCheck cannot handle that,
>> +// hence the use of | count 0.
>> +
>> +template 
>> +struct OutputStream {
>> +  OutputStream <<(C);
>> +};
>> +
>> +template 
>> +struct foo {
>> +  typedef OutputStream stream_type;
>> +  foo(stream_type ) {
>> +o << 'x'; // warning occured here, fixed now
>> +  }
>> +};
>> +
>> +void bar(OutputStream ) {
>> +  foo f(o);
>> +}
>> 
>> 
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org 
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits 
>> 
>> 
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang-tools-extra] r314808 - [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise

2017-10-03 Thread Jonas Toth via cfe-commits
Hi Juergen,

i did already work on fixing the issue I introduced with the commits. I
am currently waiting for the buildbot to catch up with the committed fix.

As far as i can see, the newer commits did actually fix (at least
chapunis buildbot did go green again), but i have my eye on it.

Cheers, Jonas


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

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang-tools-extra] r314808 - [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise

2017-10-03 Thread Juergen Ributzka via cfe-commits
Hi Jonas,

this new test is failing on Green Dragon:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/39223/consoleFull#11207350448254eaf0-7326-4999-85b0-388101f2d404

Could you please take a look?

Thanks

Cheers,
Juergen

On Tue, Oct 3, 2017 at 9:25 AM, Jonas Toth via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: jonastoth
> Date: Tue Oct  3 09:25:01 2017
> New Revision: 314808
>
> URL: http://llvm.org/viewvc/llvm-project?rev=314808=rev
> Log:
> [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise
>
> The bug happened with stream operations, that were not recognized in all
> cases.
> Even there were already existing test for streaming classes, they did not
> catch this bug.
> Adding the isolated example to the existing tests did not trigger the bug.
> Therefore i created a new isolated file that did expose the bug indeed.
>
> Differential: https://reviews.llvm.org/D38399
> reviewed by aaron.ballman
>
> Added:
> clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-
> bitwise-bug34747.cpp
> Modified:
> clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
>
> Modified: clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp?rev=
> 314808=314807=314808=diff
> 
> ==
> --- clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
> (original)
> +++ clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp Tue
> Oct  3 09:25:01 2017
> @@ -27,7 +27,9 @@ void SignedBitwiseCheck::registerMatcher
>binaryOperator(allOf(anyOf(hasOperatorName("|"),
> hasOperatorName("&"),
>   hasOperatorName("^"),
> hasOperatorName("<<"),
>   hasOperatorName(">>")),
> -   hasEitherOperand(SignedIntegerOperand)))
> +   hasEitherOperand(SignedIntegerOperand),
> +   hasLHS(hasType(isInteger())),
> +   hasRHS(hasType(isInteger()
>.bind("binary_signed"),
>this);
>
>
> Added: clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-
> bitwise-bug34747.cpp
> URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp?
> rev=314808=auto
> 
> ==
> --- clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
> (added)
> +++ clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
> Tue Oct  3 09:25:01 2017
> @@ -0,0 +1,21 @@
> +// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 |
> count 0
> +
> +// Note: this test expects no diagnostics, but FileCheck cannot handle
> that,
> +// hence the use of | count 0.
> +
> +template 
> +struct OutputStream {
> +  OutputStream <<(C);
> +};
> +
> +template 
> +struct foo {
> +  typedef OutputStream stream_type;
> +  foo(stream_type ) {
> +o << 'x'; // warning occured here, fixed now
> +  }
> +};
> +
> +void bar(OutputStream ) {
> +  foo f(o);
> +}
>
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] r314808 - [clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise

2017-10-03 Thread Jonas Toth via cfe-commits
Author: jonastoth
Date: Tue Oct  3 09:25:01 2017
New Revision: 314808

URL: http://llvm.org/viewvc/llvm-project?rev=314808=rev
Log:
[clang-tidy] Fix bug 34747, streaming operators and hicpp-signed-bitwise

The bug happened with stream operations, that were not recognized in all cases.
Even there were already existing test for streaming classes, they did not catch 
this bug.
Adding the isolated example to the existing tests did not trigger the bug.
Therefore i created a new isolated file that did expose the bug indeed.

Differential: https://reviews.llvm.org/D38399
reviewed by aaron.ballman

Added:
clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
Modified:
clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp?rev=314808=314807=314808=diff
==
--- clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/hicpp/SignedBitwiseCheck.cpp Tue Oct  3 
09:25:01 2017
@@ -27,7 +27,9 @@ void SignedBitwiseCheck::registerMatcher
   binaryOperator(allOf(anyOf(hasOperatorName("|"), hasOperatorName("&"),
  hasOperatorName("^"), hasOperatorName("<<"),
  hasOperatorName(">>")),
-   hasEitherOperand(SignedIntegerOperand)))
+   hasEitherOperand(SignedIntegerOperand),
+   hasLHS(hasType(isInteger())),
+   hasRHS(hasType(isInteger()
   .bind("binary_signed"),
   this);
 

Added: clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp?rev=314808=auto
==
--- clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp 
(added)
+++ clang-tools-extra/trunk/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp 
Tue Oct  3 09:25:01 2017
@@ -0,0 +1,21 @@
+// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 | count 0
+
+// Note: this test expects no diagnostics, but FileCheck cannot handle that,
+// hence the use of | count 0.
+
+template 
+struct OutputStream {
+  OutputStream <<(C);
+};
+
+template 
+struct foo {
+  typedef OutputStream stream_type;
+  foo(stream_type ) {
+o << 'x'; // warning occured here, fixed now
+  }
+};
+
+void bar(OutputStream ) {
+  foo f(o);
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits