summaryrefslogtreecommitdiffstats
path: root/clang/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
commitda61afaf9da903ad1c615d574ac2ceec9905389f (patch)
tree102a23c62d206bf4a41fc85935ef11ba937bae70 /clang/test/SemaTemplate/instantiate-function-params.cpp
parenta4147148ff2ffe2f78f6f03a0d48f087dd8ec284 (diff)
downloadbcm5719-llvm-da61afaf9da903ad1c615d574ac2ceec9905389f.tar.gz
bcm5719-llvm-da61afaf9da903ad1c615d574ac2ceec9905389f.zip
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. llvm-svn: 99509
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-function-params.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-function-params.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-function-params.cpp b/clang/test/SemaTemplate/instantiate-function-params.cpp
index a574dbb787e..dfba14a97c8 100644
--- a/clang/test/SemaTemplate/instantiate-function-params.cpp
+++ b/clang/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)>);
OpenPOWER on IntegriCloud