[cfe-commits] r116292 - /cfe/trunk/test/SemaCXX/expressions.cpp
John McCall
rjmccall at apple.com
Mon Oct 11 20:38:34 PDT 2010
Author: rjmccall
Date: Mon Oct 11 22:38:33 2010
New Revision: 116292
URL: http://llvm.org/viewvc/llvm-project?rev=116292&view=rev
Log:
Flesh out test.
Modified:
cfe/trunk/test/SemaCXX/expressions.cpp
Modified: cfe/trunk/test/SemaCXX/expressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/expressions.cpp?rev=116292&r1=116291&r2=116292&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/expressions.cpp (original)
+++ cfe/trunk/test/SemaCXX/expressions.cpp Mon Oct 11 22:38:33 2010
@@ -15,9 +15,20 @@
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}}
+ }
}
More information about the cfe-commits
mailing list