diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-04 21:50:46 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-04 21:50:46 +0000 |
commit | ff5243981e2f6fb4a11ab7b81bf7accc226f2647 (patch) | |
tree | 3d6fe2dad94cff269b8f72f78f40d14a05a0f7aa /test | |
parent | 938963f076418aa61b570e5317240f66642af2df (diff) |
Fix a little canonical-types issue with non-type template arguments.
Fixes PR5349.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp index 814801ccff..a6611582f1 100644 --- a/test/SemaTemplate/temp_arg_nontype.cpp +++ b/test/SemaTemplate/temp_arg_nontype.cpp @@ -136,3 +136,19 @@ namespace ns { Bar<bool(ns::Foo<int>::value)> x; } + +// PR5349 +namespace ns { + enum E { k }; + + template <E e> + struct Baz {}; + + Baz<k> f1; // This works. + Baz<E(0)> f2; // This too. + Baz<static_cast<E>(0)> f3; // And this. + + Baz<ns::E(0)> b1; // This doesn't work. + Baz<static_cast<ns::E>(0)> b2; // This neither. +} + |