summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/hicpp-signed-bitwise-bug34747.cpp
blob: bf93566afbcb882bdbee1fc36597f03d751a6e08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 <typename C>
struct OutputStream {
  OutputStream &operator<<(C);
};

template <typename C>
struct foo {
  typedef OutputStream<C> stream_type;
  foo(stream_type &o) {
    o << 'x'; // warning occured here, fixed now
  }
};

void bar(OutputStream<signed char> &o) {
  foo<signed char> f(o);
}
OpenPOWER on IntegriCloud