[PATCH] PR15677 - Crash in template diffing.
Richard Trieu
rtrieu at google.com
Mon Jun 30 19:44:28 PDT 2014
================
Comment at: lib/AST/ASTDiagnostic.cpp:1131-1137
@@ +1130,9 @@
+ if (Iter.isEnd() && ArgExpr->isValueDependent()) {
+ TemplateArgument::ArgKind Kind = Iter.getDesugar().getKind();
+ if (Kind == TemplateArgument::Integral) {
+ Int = Iter.getDesugar().getAsIntegral();
+ } else if (Kind == TemplateArgument::Expression) {
+ ArgExpr = Iter.getDesugar().getAsExpr();
+ Int = ArgExpr->EvaluateKnownConstInt(Context);
+ } else {
+ llvm_unreachable("Unexpected template argument kind");
----------------
Why did you change from a switch statement to an if chain here?
http://reviews.llvm.org/D4226
More information about the cfe-commits
mailing list