[clang] Fix a nullptr-access crash in CheckTemplateArgument.
authorHaojian Wu <hokein.wu@gmail.com>
Mon, 19 Sep 2022 13:04:42 +0000 (15:04 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Mon, 19 Sep 2022 17:18:50 +0000 (19:18 +0200)
commite782d9a4a49c8aaf65bea4209cb6a8e7739526ac
treede434d22c483f99aba2fa3a5a3fad0354e21b7c8
parent582f8ef19fe791e66c0bbe090edebfd74ba2b55d
[clang] Fix a nullptr-access crash in CheckTemplateArgument.

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.

Differential Revision: https://reviews.llvm.org/D134180
clang/lib/Sema/SemaTemplate.cpp
clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp