It is possible that we can pass a null ParamType to
CheckNonTypeTemplateParameter -- the ParamType var can be reset to a null
type on Line 6940, and the followed bailout if is not entered.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaTemplate.cpp | ||
---|---|---|
6965 | So this can only happen when Result is TDK_AlreadyDiagnosed above, right? In that case, I would handle such case explicitly in the code above, like: However, I am definitely not opposed to keeping this check here as well, in case there are other ways to get into this situation. |
Comment Actions
address review comment.
clang/lib/Sema/SemaTemplate.cpp | ||
---|---|---|
6965 | right. I think either of them works, switched to your version. |
So this can only happen when Result is TDK_AlreadyDiagnosed above, right? In that case, I would handle such case explicitly in the code above, like:
if (Result == TDK_AlreadyDiagnosed) return ExprError();
else if (Result != TDK_Success) { ... }
Seems like it would be more readable.
However, I am definitely not opposed to keeping this check here as well, in case there are other ways to get into this situation.