]> granicus.if.org Git - clang/commit
When we're creating an expression for an integral template argument of
authorDouglas Gregor <dgregor@apple.com>
Fri, 18 Feb 2011 02:12:44 +0000 (02:12 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 18 Feb 2011 02:12:44 +0000 (02:12 +0000)
commit8f5667d06a785719691c1139b961411d7f0aedf5
tree19366c905ad4a27f7d1e4f2767d7932b1f0b07f5
parent4ae493cccbfbf122ec6ebac0e330232c22fa8489
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