Skip to content

Commit 44a57ac

Browse files
committed
Distinguish stream operators from binary shifts
1 parent 5ba5f3a commit 44a57ac

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cpp/common/src/codingstandards/cpp/Operator.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class UserBitwiseOperator extends Function {
170170
op in ["&", "|", "^", "~", "%", "<<", ">>"]
171171
) and
172172
not this.isCompilerGenerated() and
173-
not this.getType().hasName("ostream") and
174-
not this.getType().hasName("istream")
173+
not this.getType().(ReferenceType).getBaseType().hasName("ostream") and
174+
not this.getType().(ReferenceType).getBaseType().hasName("istream")
175175
}
176176
}
177177

cpp/common/test/includes/standard-library/ostream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#ifndef _GHLIBCPP_OSTREAM
22
#define _GHLIBCPP_OSTREAM
33
#include "string.h"
4+
#include <ios>
45

56
namespace std {
67
template <class charT, class traits>

0 commit comments

Comments
 (0)