aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/default-expr-arguments.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-09 19:27:57 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-09 19:27:57 +0000
commitd47c47d65e339ab1f28e9f9365159cf1047ac1df (patch)
tree28f8ecc3a44dd606a0cf28f35e987b8937c55ee3 /test/SemaTemplate/default-expr-arguments.cpp
parent80c30dad6c6fca077293125a96f464b6c8857171 (diff)
Make sure that we instantiate default function arguments for an
overloaded operator(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp
index c136eee0f6..34ac2d967e 100644
--- a/test/SemaTemplate/default-expr-arguments.cpp
+++ b/test/SemaTemplate/default-expr-arguments.cpp
@@ -65,8 +65,8 @@ void test_x0(X0<int> xi) {
xi.f(17);
}
-struct NotDefaultConstructible { // expected-note{{candidate}}
- NotDefaultConstructible(int); // expected-note{{candidate}}
+struct NotDefaultConstructible { // expected-note 2{{candidate}}
+ NotDefaultConstructible(int); // expected-note 2{{candidate}}
};
void test_x0_not_default_constructible(X0<NotDefaultConstructible> xn) {
@@ -85,6 +85,18 @@ void test_X1() {
X1<int> x1;
}
+template<typename T>
+struct X2 {
+ void operator()(T = T()); // expected-error{{no matching}}
+};
+
+void test_x2(X2<int> x2i, X2<NotDefaultConstructible> x2n) {
+ x2i();
+ x2i(17);
+ x2n(NotDefaultConstructible(17));
+ x2n(); // expected-note{{in instantiation of default function argument}}
+}
+
// PR5283
namespace PR5283 {
template<typename T> struct A {
@@ -131,3 +143,4 @@ namespace pr5301 {
h(0);
}
}
+