From nobody Sun Jul 23 18:27:17 2023
X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R8BbW0LR0z4p6S2;
	Sun, 23 Jul 2023 18:27:19 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4R8BbV2jDgz3hRm;
	Sun, 23 Jul 2023 18:27:18 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1690136838;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=rqV3DkKaiBsSI7PhL1Ijl7qQXHihMIkKZEDQ6y94cgQ=;
	b=vx45YMT5fd6xv3zb5WeYHHOTEyXQlO7/gNfOTnCk5AJDh8cfOoC2EDaa63vjiwGaP3XIKk
	7pG8usOo1ZR4pBDHpNftJCyrtH3jSOrNapfgYLrbWGnR/yoCNHSAeyn2co3XYODTpNH+cj
	WPszDvjBYViz3o4v2/J/B24I6XkQJPhF8SLzXG4yfBegW5Ju7hD+ykFYLlqboM2oUP59xI
	eKi5WX55NI+IyNRQnV/f3cCUKHUCq0ToR5RDFeq+3IH4mqKuQXDSOfUe/foe+ZnpXU/5m+
	5zzzD2c8QQOhRv1HcpHc2piIhOgea1OQeMpnNTnbh0XWgIx9c4E2LsIEYCkhnQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1690136838;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding;
	bh=rqV3DkKaiBsSI7PhL1Ijl7qQXHihMIkKZEDQ6y94cgQ=;
	b=NonZ79D8bbDzJLvXlg13cS82Tb5MGZxsGgUpWuTeErGd4Hzky1up/7CphQTbDspb7hVbxc
	pMe+hFR1GCbuqGc/y1koKTDZxmwgm3BYgoFW22HjNW++cDAM8gZcO0qUkSyUpo4TcbPoP0
	HwAEFjGGb6I2GfHFffvEdPlY9PWbhT2GAnwr8mqMGUkhqNDK9eakI6m1k5cDVdo2IA0tkc
	H9PsLJ2uZEWUTed92Zz7cbX5LPkDlBikLmchPC80uHDy8rxR7n4xXnUP4wt3kKHdtzaO8r
	CpAlaZ/3co9s6to/4mzG9PHtNpP+Cmm83q+PtLj5SRt4ZA5UQSQTHCad0/ACLA==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690136838; a=rsa-sha256; cv=none;
	b=r7YVNk7hesea79aFLRY3Qv2O5WXXe8g+Rjdf/rGv1usO+z/PUmZZsZzI24v97zkprDAeGW
	P6i4lLQoeKEQg7UaPQoczYcbFYNAK6hqQHt2k+TfFWPu7v+JTE6ERzSH3zHKWhIGyBsz7Y
	7501fUKMN4Y/Wcrc4a0Wz0EuDWdyLdJzOVTZryyIbqEtx277y6GmJalwm9SPsEp+3aB6ux
	wVrxrGwwWwYYj+VXZW+4vcmRvt43nZ5QpSsQw03cXn+rYyrFewwrotpUhsCHLNQdeMxm1h
	wF1tWvjV1mde6Hcslt5gsSelXVIuU0jgN7sae4FslJTYXqU+Fjb1AtbYRF4xnw==
Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R8BbV0dn2zmhl;
	Sun, 23 Jul 2023 18:27:18 +0000 (UTC)
	(envelope-from git@FreeBSD.org)
Received: from gitrepo.freebsd.org ([127.0.1.44])
	by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36NIRHEA058928;
	Sun, 23 Jul 2023 18:27:18 GMT
	(envelope-from git@gitrepo.freebsd.org)
Received: (from git@localhost)
	by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36NIRHkC058927;
	Sun, 23 Jul 2023 18:27:17 GMT
	(envelope-from git)
Date: Sun, 23 Jul 2023 18:27:17 GMT
Message-Id: <202307231827.36NIRHkC058927@gitrepo.freebsd.org>
To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,
        dev-commits-src-branches@FreeBSD.org
From: Dimitry Andric <dim@FreeBSD.org>
Subject: git: 784ed70844eb - stable/13 - Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu):
List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches
List-Help: <mailto:dev-commits-src-branches+help@freebsd.org>
List-Post: <mailto:dev-commits-src-branches@freebsd.org>
List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org>
List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org>
Sender: owner-dev-commits-src-branches@freebsd.org
X-BeenThere: dev-commits-src-branches@freebsd.org
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Git-Committer: dim
X-Git-Repository: src
X-Git-Refname: refs/heads/stable/13
X-Git-Reftype: branch
X-Git-Commit: 784ed70844eb12f3b62dfc9e9f03b9bef97bee54
Auto-Submitted: auto-generated

The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=784ed70844eb12f3b62dfc9e9f03b9bef97bee54

commit 784ed70844eb12f3b62dfc9e9f03b9bef97bee54
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-07-19 09:18:50 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-07-23 17:38:12 +0000

    Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu):
    
      [clang][AST] Propagate the contains-errors bit to DeclRefExpr from VarDecl's initializer.
    
      Similar to the https://reviews.llvm.org/D86048 (it only sets the bit for C++
      code), we propagate the contains-errors bit for C-code path.
    
      Fixes https://github.com/llvm/llvm-project/issues/50236
      Fixes https://github.com/llvm/llvm-project/issues/50243
      Fixes https://github.com/llvm/llvm-project/issues/48636
      Fixes https://github.com/llvm/llvm-project/issues/50320
    
      Differential Revision: https://reviews.llvm.org/D154861
    
    This fixes an assertion ('Assertion failed: ((LHSExpr->containsErrors()
    || RHSExpr->containsErrors()) && "Should only occur in error-recovery
    path."), function BuildBinOp') when building parts of dtrace in certain
    scenarios.
    
    Reported by:    dstolfa
    PR:             271047
    MFC after:      1 month
    
    (cherry picked from commit 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620)
---
 contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp
index eb9afbdb1c87..b5c783b07d92 100644
--- a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp
+++ b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp
@@ -489,7 +489,7 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) {
   // more bullets here that we handle by treating the declaration as having a
   // dependent type if they involve a placeholder type that can't be deduced.]
   if (Type->isDependentType())
-    return Deps | ExprDependence::TypeValueInstantiation;
+    Deps |= ExprDependence::TypeValueInstantiation;
   else if (Type->isInstantiationDependentType())
     Deps |= ExprDependence::Instantiation;
 
@@ -525,13 +525,13 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) {
   //   - it names a potentially-constant variable that is initialized with an
   //     expression that is value-dependent
   if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
-    if (Var->mightBeUsableInConstantExpressions(Ctx)) {
-      if (const Expr *Init = Var->getAnyInitializer()) {
-        if (Init->isValueDependent())
-          Deps |= ExprDependence::ValueInstantiation;
-        if (Init->containsErrors())
-          Deps |= ExprDependence::Error;
-      }
+    if (const Expr *Init = Var->getAnyInitializer()) {
+      if (Init->containsErrors())
+        Deps |= ExprDependence::Error;
+
+      if (Var->mightBeUsableInConstantExpressions(Ctx) &&
+          Init->isValueDependent())
+        Deps |= ExprDependence::ValueInstantiation;
     }
 
     // - it names a static data member that is a dependent member of the