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.

llvm-svn: 121862
2 files changed
tree: 131ad53a135633fb8431f7ccad79b1004c3dc2ea
  1. clang/
  2. compiler-rt/
  3. debuginfo-tests/
  4. libcxx/
  5. lldb/
  6. llvm/