[all-commits] [llvm/llvm-project] 21dfe4: [Clang] Fix assert in Sema::LookupTemplateName so ...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Fri Aug 26 09:41:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21dfe482e13e3b64801372f8b3db75eeb85b3135
      https://github.com/llvm/llvm-project/commit/21dfe482e13e3b64801372f8b3db75eeb85b3135
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/test/SemaCXX/member-expr.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list