summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/default-arguments.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2012-03-13 08:55:35 +0000
committerJames Molloy <james.molloy@arm.com>2012-03-13 08:55:35 +0000
commit9cda03ff7fc40b727d0cc44b1702dbae09d63f42 (patch)
treec6810bc9b1c12832eb2e96551581f15c0fb1274f /test/CodeGenCXX/default-arguments.cpp
parente37f484ab9a65ce4e5f90adcfa20add4215e0783 (diff)
Ensure that default arguments are handled correctly in sub scopes. For example:
void f () { int g (int a, int b=4); { int g(int a, int b=5); } } should compile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152621 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/default-arguments.cpp')
-rw-r--r--test/CodeGenCXX/default-arguments.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/default-arguments.cpp b/test/CodeGenCXX/default-arguments.cpp
index 6560d3514f..206d4d6c88 100644
--- a/test/CodeGenCXX/default-arguments.cpp
+++ b/test/CodeGenCXX/default-arguments.cpp
@@ -63,3 +63,14 @@ void f3() {
B *bs = new B[2];
delete bs;
}
+
+void f4() {
+ void g4(int a, int b = 7);
+ {
+ void g4(int a, int b = 5);
+ }
+ void g4(int a = 5, int b);
+
+ // CHECK: call void @_Z2g4ii(i32 5, i32 7)
+ g4();
+}