blob: b330d6ecf4628c2fb8520894cd9ee14ea69b65ed [file] [log] [blame]
// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR4103 : Make sure we don't get a bogus unused expression warning
namespace PR4103 {
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>();
}
}
namespace derefvolatile {
void f(volatile char* x) {
*x; // expected-warning {{expression result unused; assign into a variable to force a volatile load}}
(void)*x; // expected-warning {{expression result unused; assign into a variable to force a volatile load}}
}
}