diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-03 20:22:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-03 20:22:41 +0000 |
commit | f7d72f5a4a3f0e610d77c6779ca3c21920a14bc7 (patch) | |
tree | a7c744f33c4d237d7d1886bcf6e0b1c43b859760 /test/SemaTemplate/instantiate-function-1.cpp | |
parent | da5a428bf3db404fe3c91b689cd87c68789d6db9 (diff) |
When instantiating a function-local variable definition, introduce the
mapping from the declaration in the template to the instantiated
declaration before transforming the initializer, in case some crazy
lunatic decides to use a variable in its own initializer. Fixes PR7016.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102945 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-function-1.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-function-1.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-function-1.cpp b/test/SemaTemplate/instantiate-function-1.cpp index 6e0d711590..1bda43000b 100644 --- a/test/SemaTemplate/instantiate-function-1.cpp +++ b/test/SemaTemplate/instantiate-function-1.cpp @@ -220,3 +220,8 @@ namespace test0 { template <class T> class A { void foo(T array[10]); }; template class A<int>; } + +namespace PR7016 { + template<typename T> void f() { T x = x; } + template void f<int>(); +} |