freebsd-dev/contrib/llvm-project/clang
Dimitry Andric 56f2446575 Apply clang fix for assertion building emulators/rpcs3
Merge commit a5e1a93ea10f from llvm-project (by Mariya Podchishchaeva):

  [clang] Fix crash when handling nested immediate invocations

  Before this patch it was expected that if there was several immediate
  invocations they all belong to the same expression evaluation context.
  During parsing of non local variable initializer a new evaluation context is
  pushed, so code like this
  ```
  namespace scope {
  struct channel {
      consteval channel(const char* name) noexcept { }
  };
  consteval const char* make_channel_name(const char* name) { return name;}

  channel rsx_log(make_channel_name("rsx_log"));
  }
  ```
  produced a nested immediate invocation whose subexpressions are attached
  to different expression evaluation contexts. The constructor call
  belongs to TU context and `make_channel_name` call to context of
  variable initializer.

  This patch removes this assumption and adds tracking of previously
  failed immediate invocations, so it is possible when handling an
  immediate invocation th check that its subexpressions from possibly another
  evaluation context contains errors and not produce duplicate
  diagnostics.

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

  Reviewed By: aaron.ballman, shafik

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

PR:		269489
MFC after:	3 days
2023-04-28 16:09:45 +02:00
..
include Apply clang fix for assertion building emulators/rpcs3 2023-04-28 16:09:45 +02:00
lib Apply clang fix for assertion building emulators/rpcs3 2023-04-28 16:09:45 +02:00
tools Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b 2023-02-08 20:04:38 +01:00
utils/TableGen Merge llvm-project release/15.x llvmorg-15.0.0-9-g1c73596d3454 2023-02-08 20:05:02 +01:00
LICENSE.TXT