summaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/unused.cpp
blob: 88783ce1a6b3d53479ff05b6313bdc51ac678f5b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR4103 : Make sure we don't get a bogus unused expression warning
class APInt {
  char foo;
};
class APSInt : public APInt {
  char bar;
public:
  APSInt &operator=(const APSInt &RHS);
};

APSInt& APSInt::operator=(const APSInt &RHS) {
  APInt::operator=(RHS);
  return *this;
}

template<typename T>
struct X {
  X();
};

void test() {
  X<int>();
}