[Clang] Fix assert in Sema::LookupTemplateName so that it does not attempt an uncondi...
authorShafik Yaghmour <shafik.yaghmour@intel.com>
Fri, 26 Aug 2022 16:12:29 +0000 (09:12 -0700)
committerShafik Yaghmour <shafik.yaghmour@intel.com>
Fri, 26 Aug 2022 16:40:43 +0000 (09:40 -0700)
commit21dfe482e13e3b64801372f8b3db75eeb85b3135
tree7dd9be026dd2db6e93237e516818fec2438f001d
parentf9445ae75c55ce4a0ff33bdaedefee00b9a27704
[Clang] Fix assert in Sema::LookupTemplateName so that it does not attempt an unconditional cast to TagType

In Sema::LookupTemplateName(...) seeks to assert that the ObjectType is complete
or being defined. If the type is incomplete it will attempt to unconditionally
cast it to a TagType and not all incomplete types are a TagType. For example the
type could be void or it could be an IncompleteArray.

This change adds an additional check to confirm it is a TagType before attempting
to check if it is incomplete or being defined

Differential Revision: https://reviews.llvm.org/D132712
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaTemplate.cpp
clang/test/SemaCXX/member-expr.cpp