[all-commits] [llvm/llvm-project] 0d93f2: Fix references to complete types in attribute refe...

Erich Keane via All-commits all-commits at lists.llvm.org
Wed Jul 15 06:57:53 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d93f2aec0b4847761bd8458b7847ce37b85cf03
      https://github.com/llvm/llvm-project/commit/0d93f2aec0b4847761bd8458b7847ce37b85cf03
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/test/SemaCXX/enable_if.cpp

  Log Message:
  -----------
  Fix references to complete types in attribute references (#209537)

This is a regression from #197215.

Attributes are not REALLY in the body of a function (though the name of
said function is... awkwardly inaccurate at best), but still need to pay
attention to the completeness of their references. As a result, we
weren't marking the expression as invalid, but were also trying to
evaluate it.

This patch fixes this in 2 ways. First, we re-add the
CXXThisTypeOverride check, but except constant substitution, since that
has some additional 'this' behavior from #197215. x

Secondly, we also make the constant evaluator give up on incomplete
types when handling an L value member. This stops us from trying to
evaluate the value if it is incomplete during template instantiation,
when the type is incomplete. We don't diagnose, since it is still
potentially a constant expression, but isn't currently one.

Fixes: #199527



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list