summaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/unused.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/unused.cpp')
-rw-r--r--clang/test/SemaCXX/unused.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/unused.cpp b/clang/test/SemaCXX/unused.cpp
new file mode 100644
index 0000000..88783ce
--- /dev/null
+++ b/clang/test/SemaCXX/unused.cpp
@@ -0,0 +1,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>();
+}