argument of enumeration type when checking template arguments. Fixes PR10579.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137101
91177308-0d34-0410-b5e6-
96231b3b80d8
}
Converted = TemplateArgument(Value,
- ParamType->isEnumeralType() ? ParamType
- : IntegerType);
+ ParamType->isEnumeralType()
+ ? Context.getCanonicalType(ParamType)
+ : IntegerType);
return Owned(Arg);
}
void test_char_single_quote() { enable_if_char<'\''>::type i; } // expected-error{{enable_if_char<'\''>}}
void test_char_backslash() { enable_if_char<'\\'>::type i; } // expected-error{{enable_if_char<'\\'>}}
}
+
+namespace PR10579 {
+ namespace fcppt
+ {
+ namespace container
+ {
+ namespace bitfield
+ {
+
+ template<
+ typename Enum,
+ Enum Size
+ >
+ class basic;
+
+ template<
+ typename Enum,
+ Enum Size
+ >
+ class basic
+ {
+ public:
+ basic()
+ {
+ }
+ };
+
+ }
+ }
+ }
+
+ namespace
+ {
+
+ namespace testenum
+ {
+ enum type
+ {
+ foo,
+ bar,
+ size
+ };
+ }
+
+ }
+
+ int main()
+ {
+ typedef fcppt::container::bitfield::basic<
+ testenum::type,
+ testenum::size
+ > bitfield_foo;
+
+ bitfield_foo obj;
+ }
+
+}