aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-function-params.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-25 15:38:42 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-25 15:38:42 +0000
commit2b0749a4f8965d0205bf77322db150c13c39e3be (patch)
treedd4377ff97da634fe9b2d17f63a052e5cdbafdce /test/SemaTemplate/instantiate-function-params.cpp
parent0d1407e8784844397e0f754a2212161c563f25fa (diff)
Improve our handling of local instantiation scopes in two related ways:
- When substituting template arguments as part of template argument deduction, introduce a new local instantiation scope. - When substituting into a function prototype type, introduce a new "temporary" local instantiation scope that merges with its outer scope but also keeps track of any additions it makes, removing them when we exit that scope. Fixes PR6700, where we were getting too much mixing of local instantiation scopes due to template argument deduction that substituted results into function types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-function-params.cpp')
-rw-r--r--test/SemaTemplate/instantiate-function-params.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-function-params.cpp b/test/SemaTemplate/instantiate-function-params.cpp
index a574dbb787..dfba14a97c 100644
--- a/test/SemaTemplate/instantiate-function-params.cpp
+++ b/test/SemaTemplate/instantiate-function-params.cpp
@@ -31,3 +31,14 @@ template < typename TT > struct ForwardIterator : I
};
typedef instantiate< &requirement_<void(*)(ForwardIterator<char*> x)>::failed> boost_concept_checkX; // expected-error{{no member named}} \
// expected-note 6{{in instantiation}}
+
+template<typename T> struct X0 { };
+template<typename R, typename A1> struct X0<R(A1 param)> { };
+
+template<typename T, typename A1, typename A2>
+void instF0(X0<T(A1)> x0a, X0<T(A2)> x0b) {
+ X0<T(A1)> x0c;
+ X0<T(A2)> x0d;
+}
+
+template void instF0<int, int, float>(X0<int(int)>, X0<int(float)>);