Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed IntegerLiterals

BuildExpressionFromIntegralTemplateArgument can produce malformed
IntegerLiterals with an EnumType if the template parameter type
is an EnumType.  This breaks the AST printer which expects all
IntegerLiterals to have a plain integer type.  Instead, give the
IntegerLiteral the enum's promotion type and wrap in an implicit cast
to the EnumType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121862 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed