Avoid nullptr dereferencing of 'Constraint'; NFC
authorSindhu Chittireddy <sindhu.chittireddy@intel.com>
Tue, 24 Aug 2021 11:08:18 +0000 (07:08 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 24 Aug 2021 11:08:18 +0000 (07:08 -0400)
commit98339f14a0420cdfbe4215d8d1bc0a01165e0495
tree7e30557c8149c9737a16b6b37123a2804462ac68
parentebf35370ff596dcbd8a4a74b865cd066440510a2
Avoid nullptr dereferencing of 'Constraint'; NFC

Klocwork static code analysis exposed this bug:
Pointer 'Constraint' returned from call to function
'cast_or_null<clang::ConceptSpecializationExpr,clang::Expr>' may
be NULL and will be dereferenced in the statement following it

Replace 'cast_or_null' with 'cast' so that the latter can assert
when it encounters a NULL.

This also removes an 'assert' that is covered by the previous
call to 'cast<>'.
clang/lib/Sema/SemaConcept.cpp