summaryrefslogtreecommitdiff
path: root/test/Parser/cxx-default-args.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commit06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /test/Parser/cxx-default-args.cpp
parent30d791273d07fac9c0c1641a0731191bca6e8606 (diff)
Notes
Diffstat (limited to 'test/Parser/cxx-default-args.cpp')
-rw-r--r--test/Parser/cxx-default-args.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Parser/cxx-default-args.cpp b/test/Parser/cxx-default-args.cpp
index 36abf0d8cb38..0095a2f04dc4 100644
--- a/test/Parser/cxx-default-args.cpp
+++ b/test/Parser/cxx-default-args.cpp
@@ -31,3 +31,13 @@ struct T {
void f7(bool a = T1<int, bool>::V < 3);
void f8(int = func<0,1<2>(0), int = 1<0, T1<int,int>(int) = 0);
};
+
+// rdar://18508589
+struct S {
+ void f(int &r = error); // expected-error {{use of undeclared identifier 'error'}}
+};
+
+struct U {
+ void i(int x = ) {} // expected-error{{expected expression}}
+ typedef int *fp(int x = ); // expected-error{{default arguments can only be specified for parameters in a function declaration}}
+};