summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-09 01:55:14 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-09 01:55:14 +0000
commit3d63a9e50157eee3f3d46c831df3323f36083bc7 (patch)
tree532f2b86ab3a1fd48d7841394cc2295e6543750a /clang/lib/Sema/SemaTemplate.cpp
parent2fc107365bbb3dce455abbbdcf54003f3a56f803 (diff)
downloadbcm5719-llvm-3d63a9e50157eee3f3d46c831df3323f36083bc7.tar.gz
bcm5719-llvm-3d63a9e50157eee3f3d46c831df3323f36083bc7.zip
Make sure to canonicalize the argument type of a non-type template
argument of enumeration type when checking template arguments. Fixes PR10579. llvm-svn: 137101
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 006017f5a47..e960452e06a 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud