When we're creating an expression for an integral template argument of
commitae95896016faa19426a793c186c9bbcbfbf291a5
authorDouglas Gregor <doug.gregor@gmail.com>
Fri, 18 Feb 2011 02:12:44 +0000 (18 02:12 +0000)
committerDouglas Gregor <doug.gregor@gmail.com>
Fri, 18 Feb 2011 02:12:44 +0000 (18 02:12 +0000)
tree19366c905ad4a27f7d1e4f2767d7932b1f0b07f5
parent020dd62774ff2eaf1ad1cedbad929fd46ccae2e4
When we're creating an expression for an integral template argument of
enumeration type, we were generating an integer literal implicitly
casted to the appropriate enumeration type. However, later checks on
that expression would strip the implicit cast.

This commit tweaks the lame hack, by creating an explicit cast instead
of an implicit cast. The right answer is to introduce a
SubstNonTypeTemplateParmExpr expression that acts like the substituted
result. I'll investigate that soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125818 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplate.cpp
test/SemaTemplate/instantiate-non-type-template-parameter.cpp