diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-09 01:55:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-09 01:55:14 +0000 |
commit | 6b63f551b183e14fab6ac51d6e5199c90b699035 (patch) | |
tree | ec0d05c365dded0e22f1f90adb6ce18ce16999b4 /lib/Sema/SemaTemplate.cpp | |
parent | 3f86ce1dc64a46d9cd3675787b8af32c9158abe6 (diff) |
Make sure to canonicalize the argument type of a non-type template
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
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 006017f5a4..e960452e06 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3820,8 +3820,9 @@ ExprResult Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, } Converted = TemplateArgument(Value, - ParamType->isEnumeralType() ? ParamType - : IntegerType); + ParamType->isEnumeralType() + ? Context.getCanonicalType(ParamType) + : IntegerType); return Owned(Arg); } |