DebugInfo: Defaulted non-type template parameters of bool type
Caused an assertion due to mismatched bit widths - this seems like the
right API to use for a possibly width-varying equality test. Though
certainly open to some post-commit review feedback if there's a more
suitable way to do this comparison/test.
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 49c57e9..6d3c2ad 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1817,9 +1817,10 @@
if (auto *templateType =
dyn_cast_or_null<NonTypeTemplateParmDecl>(TPList->getParam(i)))
if (templateType->hasDefaultArgument())
- defaultParameter =
+ defaultParameter = llvm::APSInt::isSameValue(
templateType->getDefaultArgument()->EvaluateKnownConstInt(
- CGM.getContext()) == TA.getAsIntegral();
+ CGM.getContext()),
+ TA.getAsIntegral());
TemplateParams.push_back(DBuilder.createTemplateValueParameter(
TheCU, Name, TTy, defaultParameter,