Fixes PR5349.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86052
91177308-0d34-0410-b5e6-
96231b3b80d8
ArgType = Context.getCanonicalType(ArgType).getUnqualifiedType();
// Try to convert the argument to the parameter's type.
- if (ParamType == ArgType) {
+ if (Context.hasSameType(ParamType, ArgType)) {
// Okay: no conversion necessary
} else if (IsIntegralPromotion(Arg, ArgType, ParamType) ||
!ParamType->isEnumeralType()) {
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.
+}
+