]> granicus.if.org Git - clang/commitdiff
Flesh out test.
authorJohn McCall <rjmccall@apple.com>
Tue, 12 Oct 2010 03:38:33 +0000 (03:38 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 12 Oct 2010 03:38:33 +0000 (03:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116292 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/expressions.cpp

index 6bf59d1167cecdca37cd4335d8b6aa772c4633e9..c4e9dccbf62161a672a61aeca582b44897554384 100644 (file)
@@ -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}}
+  }
 }