diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-01 19:00:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-01 19:00:07 +0000 |
commit | 96084f171f4824397dc48453146f0a9719cb9247 (patch) | |
tree | c92864eff4e445ea69c6a2e32e88f879857aa027 /test/SemaTemplate/instantiate-enum.cpp | |
parent | 00225547b51b42f7400eed36475b6672418a1151 (diff) |
When instantiating a function-scoped enum, make sure that it and its
enumeration constants get placed into the local instantiation hash
table. Fixes PR6375.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-enum.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-enum.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-enum.cpp b/test/SemaTemplate/instantiate-enum.cpp index 6f9aa4b116..5353a92a90 100644 --- a/test/SemaTemplate/instantiate-enum.cpp +++ b/test/SemaTemplate/instantiate-enum.cpp @@ -9,3 +9,19 @@ struct adder { }; int array1[adder<long, 3, 4>::value == 7? 1 : -1]; + +namespace PR6375 { + template<typename T> + void f() { + enum Enum + { + enumerator1 = 0xFFFFFFF, + enumerator2 = enumerator1 - 1 + }; + + int xb1 = enumerator1; + int xe1 = enumerator2; + } + + template void f<int>(); +} |