When converting an integral template argument value to a non-type
template parameter of type 'bool', force the value to be zero or
one. Fixes <rdar://problem/9169404>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130873 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/partial-spec-instantiate.cpp b/test/SemaTemplate/partial-spec-instantiate.cpp
index 68b4964..a93af50 100644
--- a/test/SemaTemplate/partial-spec-instantiate.cpp
+++ b/test/SemaTemplate/partial-spec-instantiate.cpp
@@ -38,3 +38,13 @@
return y.m + y2.m;
}
}
+
+// <rdar://problem/9169404>
+namespace rdar9169404 {
+ template<typename T, T N> struct X { };
+ template<bool C> struct X<bool, C> {
+ typedef int type;
+ };
+
+ X<bool, -1>::type value;
+}