Restore the C-style cast hack for enum template arguments,
which is required given the current setup for template
argument deduction substitution validation, and add a test
case to make sure we don't break it in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135262 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp
index 15c061c..aecb5ee 100644
--- a/test/SemaTemplate/deduction.cpp
+++ b/test/SemaTemplate/deduction.cpp
@@ -150,3 +150,15 @@
}
};
}
+
+// Verify that we can deduce enum-typed arguments correctly.
+namespace test14 {
+ enum E { E0, E1 };
+ template <E> struct A {};
+ template <E e> void foo(const A<e> &a) {}
+
+ void test() {
+ A<E0> a;
+ foo(a);
+ }
+}