[all-commits] [llvm/llvm-project] 859600: [clang] Add the check of membership in decltype fo...

limingliv via All-commits all-commits at lists.llvm.org
Wed Jan 4 07:47:31 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85960043d594fc12d340ccb66a30861b023ab496
      https://github.com/llvm/llvm-project/commit/85960043d594fc12d340ccb66a30861b023ab496
  Author: Liming Liu <gangliugangliu.ml at outlook.com>
  Date:   2023-01-04 (Wed, 04 Jan 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/decltype.cpp

  Log Message:
  -----------
  [clang] Add the check of membership in decltype for the issue #58674#

Originally, the code would take a lookup result as a member in the
current scope and build a member expression accordingly, if the lookup
result was not an operand of the address operator, or it was a field
declaration. However, a field declaration may come from another class,
and cause the issue #58674.

Thus, this patch fixes the issue via checking where does the field
declaration comes from, and if it comes from another class, then marks
it as not member in the current scope. The parent scopes of the current
scope are also checked, as the current scope may be associated to a
lambda or friend declaration.

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




More information about the All-commits mailing list