[all-commits] [llvm/llvm-project] 9daf10: Reland [Clang] skip default argument instantiation...

Oleksandr T. via All-commits all-commits at lists.llvm.org
Wed Dec 18 02:36:44 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9daf10ff8f29ba3a88a105aaa9d2379c21b77d35
      https://github.com/llvm/llvm-project/commit/9daf10ff8f29ba3a88a105aaa9d2379c21b77d35
  Author: Oleksandr T. <oleksandr.tarasiuk at outlook.com>
  Date:   2024-12-18 (Wed, 18 Dec 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CXX/temp/temp.res/p4.cpp
    M clang/test/CodeGenCXX/default-arguments.cpp

  Log Message:
  -----------
  Reland [Clang] skip default argument instantiation for non-defining friend declarations to meet [dcl.fct.default] p4 (#115487)

This fixes a crash when instantiating default arguments for templated
friend function declarations which lack a definition.
There are implementation limits which prevents us from finding the
pattern for such functions, and this causes difficulties
setting up the instantiation scope for the function parameters.

This patch skips instantiating the default argument in these cases,
which causes a minor regression in error recovery, but otherwise avoids
the crash.

The previous attempt #113777 accidentally skipped all default argument
constructions, causing some regressions. This patch resolves that by
moving the guard to InstantiateDefaultArgument() where the handling of
templates takes place.

Fixes https://github.com/llvm/llvm-project/issues/113324



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