aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/default-expr-arguments.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-05 05:38:54 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-05 05:38:54 +0000
commit6bc107b49862418bf3f64f74f17e472b4c13aa71 (patch)
tree80d059f93e89cf4e690d5465fc7755f1f68e6c3c /test/SemaTemplate/default-expr-arguments.cpp
parent25cae7f4b1155b1a6ca959ea5143ea39eae656cd (diff)
Report errors for member functions correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp
index 5c95e511a7..925d52fb19 100644
--- a/test/SemaTemplate/default-expr-arguments.cpp
+++ b/test/SemaTemplate/default-expr-arguments.cpp
@@ -21,6 +21,7 @@ void g() {
template<typename T> struct F {
F(T t = 10);
+ void f(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}}
};
struct FD : F<int> { };
@@ -30,6 +31,11 @@ void g2() {
FD fd;
}
+void g3(F<int> f, F<struct S> s) {
+ f.f();
+ s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}}
+}
+
template<typename T> struct G {
G(T) {}
};
@@ -37,3 +43,4 @@ template<typename T> struct G {
void s(G<int> flags = 10) { }
+