aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/ast-print.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-10-18 21:53:46 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-10-18 21:53:46 +0000
commit25c9bc117d8825dce7911f6fddf3725d1914a7c6 (patch)
tree2f5d1ad005b6f403c2c277531f66b0445bcaddac /test/SemaCXX/ast-print.cpp
parentda3301eec823fe770bfa49a1cb19649506caa698 (diff)
Use the type as written when pretty-printing C-style casts. Patch by Grzegorz Jablonski.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/ast-print.cpp')
-rw-r--r--test/SemaCXX/ast-print.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/test/SemaCXX/ast-print.cpp b/test/SemaCXX/ast-print.cpp
index 15fdabfe32..5e89c8b548 100644
--- a/test/SemaCXX/ast-print.cpp
+++ b/test/SemaCXX/ast-print.cpp
@@ -13,8 +13,7 @@ struct Reference
MyClass* operator ->() { return object; }
};
-int main()
-{
+void test1() {
Reference r;
(r->method());
}
@@ -23,7 +22,7 @@ int main()
// CHECK: while (int a = 1)
// CHECK: switch (int a = 1)
-void f()
+void test2()
{
if (int a = 1) { }
while (int a = 1) { }
@@ -32,7 +31,7 @@ void f()
// CHECK: new (1) int;
void *operator new (typeof(sizeof(1)), int, int = 2);
-void f2() {
+void test3() {
new (1) int;
}
@@ -40,9 +39,16 @@ void f2() {
struct X {
void *operator new (typeof(sizeof(1)), int = 2);
};
-void f2() { new X; }
+void test4() { new X; }
// CHECK: for (int i = 2097, j = 42; false;)
-void forInit() {
+void test5() {
for (int i = 2097, j = 42; false;) {}
}
+
+// CHECK: test6fn((int &)y);
+void test6fn(int& x);
+void test6() {
+ unsigned int y = 0;
+ test6fn((int&)y);
+}