[all-commits] [llvm/llvm-project] c41be8: [Clang] Fix ClassifyImplicitMemberAccess to handle...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Tue Mar 14 16:38:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c41be8fc741dec82e6c628d0cad742285be293f6
      https://github.com/llvm/llvm-project/commit/c41be8fc741dec82e6c628d0cad742285be293f6
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExprMember.cpp
    M clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
    M clang/test/SemaCXX/statements.cpp

  Log Message:
  -----------
  [Clang] Fix ClassifyImplicitMemberAccess to handle cases where the access in an unevaluated context is not within a CXXRecordDecl or CXXMethodDecl

ClassifyImplicitMemberAccess assumes that if we are not in a static context then
the DeclContext must be a CXXRecordDecl or a CXXMethodDecl. In the case of the
unevaluated context this may not be true.

This will lead to a crash because contextClass will remain a nullptr.

Fixes: https://github.com/llvm/llvm-project/issues/37792
Fixes: https://github.com/llvm/llvm-project/issues/48405

Differential Revision: https://reviews.llvm.org/D142490




More information about the All-commits mailing list