[all-commits] [llvm/llvm-project] edf14e: [Clang] Don't form a type constraint if the concep...

Younan Zhang via All-commits all-commits at lists.llvm.org
Wed Jan 8 03:40:39 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: edf14ed6b182b9ae9efa0c854f3d4744bb67bf08
      https://github.com/llvm/llvm-project/commit/edf14ed6b182b9ae9efa0c854f3d4744bb67bf08
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2025-01-08 (Wed, 08 Jan 2025)

  Changed paths:
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriterDecl.cpp
    M clang/test/SemaTemplate/concepts.cpp

  Log Message:
  -----------
  [Clang] Don't form a type constraint if the concept is invalid (#122065)

After 0dedd6fe1 and 03229e7c0, invalid concept declarations might lack
expressions for evaluation and normalization. This could make it crash
in certain scenarios, apart from the one of evaluation concepts showed
in 03229e7c0, there's also an issue when checking specializations where
the normalization also relies on a non-null expression.

This patch prevents that by avoiding building up a type constraint in
such situations, thereafter the template parameter wouldn't have a
concept specialization of a null expression.

With this patch, the assumption in ASTWriterDecl is no longer valid.
Namely, HasConstraint and TypeConstraintInitialized must now represent
different meanings for both source fidelity and semantic requirements.

Fixes https://github.com/llvm/llvm-project/issues/115004
Fixes https://github.com/llvm/llvm-project/issues/121980



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