aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-15 18:35:15 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-15 18:35:15 +0000
commitf801dcff43b49509bf758e213de56288bd3e2a2e (patch)
tree5688622d051bf5b10ec72b215112f728fefc9d81
parentdb30c0f5cfcda4483bf4d2a02d6a94289984a4a9 (diff)
Add test case for PR5290; this bug was fixed with the non-class rvalue
de-cv-qualification fixes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108437 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaCXX/decltype.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/decltype.cpp b/test/SemaCXX/decltype.cpp
new file mode 100644
index 0000000000..b6bcd043f3
--- /dev/null
+++ b/test/SemaCXX/decltype.cpp
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
+
+// PR5290
+int const f0();
+void f0_test() {
+ decltype(0, f0()) i = 0; // expected-warning{{expression result unused}}
+ i = 0;
+}
+
+struct A { int a[1]; A() { } };
+typedef A const AC;
+int &f1(int*);
+float &f2(int const*);
+
+void test_f2() {
+ float &fr = f2(AC().a);
+}
+