aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-10-12 03:38:33 +0000
committerJohn McCall <rjmccall@apple.com>2010-10-12 03:38:33 +0000
commitf9c5afb8df90d2711fdb0d3699aba99f1db0b848 (patch)
treea77f06edba1e37236b61078a879ee223fdcaf682
parent2bf6f49ffa839c966f692420491145adeac4f1e2 (diff)
Flesh out test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116292 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/SemaCXX/expressions.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/test/SemaCXX/expressions.cpp b/test/SemaCXX/expressions.cpp
index 6bf59d1167..c4e9dccbf6 100644
--- a/test/SemaCXX/expressions.cpp
+++ b/test/SemaCXX/expressions.cpp
@@ -15,9 +15,20 @@ void f0() {
f0_1(&x);
}
-template <class T> void bar(T &x) { T::fail(); }
-template <class T> void bar(volatile T &x) {}
-void f1() {
- volatile int x;
- bar(x = 5);
+namespace test1 {
+ template <class T> void bar(T &x) { T::fail(); }
+ template <class T> void bar(volatile T &x) {}
+
+ void test_ints() {
+ volatile int x;
+ bar(x = 5);
+ bar(x += 5);
+ }
+
+ enum E { E_zero };
+ void test_enums() {
+ volatile E x;
+ bar(x = E_zero);
+ bar(x += E_zero); // expected-error {{incompatible type}}
+ }
}