summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-expr-1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-13 20:44:55 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-13 20:44:55 +0000
commitb08f1a7b329f4d56860557920c09a37608c9b6de (patch)
tree6dae34d6233753324bd253ab396ddc505846da10 /clang/test/SemaTemplate/instantiate-expr-1.cpp
parent399f499f0c915991e8ea93fc6bded34805f16f7e (diff)
downloadbcm5719-llvm-b08f1a7b329f4d56860557920c09a37608c9b6de.tar.gz
bcm5719-llvm-b08f1a7b329f4d56860557920c09a37608c9b6de.zip
Fix template instantiation for non-dependent calls to overloaded call
operators. Fixes PR5266. llvm-svn: 91252
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-expr-1.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-1.cpp b/clang/test/SemaTemplate/instantiate-expr-1.cpp
index fb88213c401..1cd55d9ad25 100644
--- a/clang/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/clang/test/SemaTemplate/instantiate-expr-1.cpp
@@ -94,3 +94,21 @@ struct Addable {
void test_add(Addable &a) {
add(a);
}
+
+struct CallOperator {
+ int &operator()(int);
+ double &operator()(double);
+};
+
+template<typename Result, typename F, typename Arg1>
+Result test_call_operator(F f, Arg1 arg1) {
+ // PR5266: non-dependent invocations of a function call operator.
+ CallOperator call_op;
+ int &ir = call_op(17);
+ return f(arg1);
+}
+
+void test_call_operator(CallOperator call_op, int i, double d) {
+ int &ir = test_call_operator<int&>(call_op, i);
+ double &dr = test_call_operator<double&>(call_op, d);
+}
OpenPOWER on IntegriCloud