From nobody Sun Jul 23 18:27:11 2023 X-Original-To: dev-commits-src-all@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 4R8BbM6Mfjz4p6Kl; Sun, 23 Jul 2023 18:27:11 +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 4R8BbM4csYz3h0P; Sun, 23 Jul 2023 18:27:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690136831; 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=mp79A7If9NlfmAvZshoi2mEqSYM9cFTolT4QPdkRlGI=; b=vSfE8SjJ/Zv4bC/+Ard1PYRoIobJQ/gDbGX22u2bTztN5vYVRxSyvU4LNPtGs8MCDv1x23 DzXxI33IZNlDuA+/zYH9MgmwAG3B6hnT54s8iJMjUUBjXwQcrMO+bXRl3Tmrfs13anSo4+ 6Uhq98JGKiGsrr4G9fD+69nlK1eKng8Smu0emxNdo+1Vv8fZGpUsUvdCwbpsebqlDC9d/v Dtfvz/dH52PoWOCTJfNJ3TCDGmaSv4/oVV4Kp7Wnxo3DgKV27ndB9dTjq6mim//dTmiwg+ prBE6jrrcOg15U7QzqeAovnx+XAGZ/hAwwleoeOqfG9o9iFJ8zhb/VuHzd4vog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690136831; 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=mp79A7If9NlfmAvZshoi2mEqSYM9cFTolT4QPdkRlGI=; b=FmlilCY6RxBtzupFrrYy/Vf64Qz6gpyhQSYCQgLfO/2SlX2lJ//xJ/anw+RiAt6ALGy0pe G1jgtkK5BYD/NnOdO+nUMbx2wAW27EbD6DK/y2X+MBC4CnZKrVwTYLEJ8rHfZ50GxLkB8n /uYVLV2yVbEMaKkUYl3lf/a5lIoAmR7yjpRRKTePtfuqP4irviEdtuGUJ74w1jUssIUDnA aPo+RrbWvfN4tbAl6BSns5fQf1h6FEB8zCv/kCfsX0kzavPNqHdcg3F2ZDy8JWhKehc1XB WsVR9p0VDtRSoRS1X8VTtVpHZ9LzlmchAVEEsjdLIH0EExTYa8B6Opbsfgr3AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690136831; a=rsa-sha256; cv=none; b=Bj0PuJ2mi53v87M0nFoS+bHfV880dTztTvuPxx03E8iCDI8jSQ1ynyhzau3f4GZ715TVQG 3XoQ933rkNSQhq04gYsTmsi29yFPdNVF7XAvuOTBZeT8of1LbQlKG+wssWdsrpoqasjERz xGGdv8/8EGHbO9tn+Aqn2b9w1jpvUmsV7+QVyeSqhXZtuv6YvwByax1oNBIABpE8CUZwbu f4p67Ok970+UlQdaFo4PPebSqQvcgiDgtPvmzyEqlfzevaLawXwHC91tPEXoH3smGyoACL cJHTVTudL7Bu/vBrtSN0o+6zy1XnMYFFpyaOVbQKGpWyEK0IUtjbbFsdHOPCKA== 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 4R8BbM31FjzmVS; Sun, 23 Jul 2023 18:27:11 +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 36NIRBtS058812; Sun, 23 Jul 2023 18:27:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36NIRB9i058811; Sun, 23 Jul 2023 18:27:11 GMT (envelope-from git) Date: Sun, 23 Jul 2023 18:27:11 GMT Message-Id: <202307231827.36NIRB9i058811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e0c3c6130c9b - stable/13 - Merge commit 69d42eef4bec from llvm-project (by Dimitry Andric): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: e0c3c6130c9bf6d1fa66061b49ee4fb6c3572d55 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e0c3c6130c9bf6d1fa66061b49ee4fb6c3572d55 commit e0c3c6130c9bf6d1fa66061b49ee4fb6c3572d55 Author: Dimitry Andric AuthorDate: 2023-06-14 18:49:59 +0000 Commit: Dimitry Andric CommitDate: 2023-07-23 17:38:10 +0000 Merge commit 69d42eef4bec from llvm-project (by Dimitry Andric): [Clang] Show type in enum out of range diagnostic When the diagnostic for an out of range enum value is printed, it currently does not show the actual enum type in question, for example: v8/src/base/bit-field.h:43:29: error: integer value 7 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] static constexpr T kMax = static_cast(kNumValues - 1); ^ This can make it cumbersome to find the cause for the problem. Add the enum type to the diagnostic message, to make it easier. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D152788 PR: 271047 MFC after: 1 month (cherry picked from commit cf24393421ca807899c599a53ddc5dcedb7c71dc) --- .../llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td | 4 ++-- contrib/llvm-project/clang/lib/AST/ExprConstant.cpp | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td index 28120d13fd9e..4e2e0bd3079c 100644 --- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td +++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticASTKinds.td @@ -393,8 +393,8 @@ def warn_fixedpoint_constant_overflow : Warning< "overflow in expression; result is %0 with type %1">, InGroup>; def warn_constexpr_unscoped_enum_out_of_range : Warning< - "integer value %0 is outside the valid range of values [%1, %2] for this " - "enumeration type">, DefaultError, InGroup>; + "integer value %0 is outside the valid range of values [%1, %2] for the " + "enumeration type %3">, DefaultError, InGroup>; // This is a temporary diagnostic, and shall be removed once our // implementation is complete, and like the preceding constexpr notes belongs diff --git a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp index 464104139cb2..db6c07d4ab7f 100644 --- a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp +++ b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp @@ -13682,12 +13682,13 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) { Info.Ctx.getDiagnostics().Report( E->getExprLoc(), diag::warn_constexpr_unscoped_enum_out_of_range) << llvm::toString(Result.getInt(), 10) << Min.getSExtValue() - << Max.getSExtValue(); + << Max.getSExtValue() << ED; else if (!ED->getNumNegativeBits() && ConstexprVar && Max.ult(Result.getInt().getZExtValue())) - Info.Ctx.getDiagnostics().Report(E->getExprLoc(), - diag::warn_constexpr_unscoped_enum_out_of_range) - << llvm::toString(Result.getInt(),10) << Min.getZExtValue() << Max.getZExtValue(); + Info.Ctx.getDiagnostics().Report( + E->getExprLoc(), diag::warn_constexpr_unscoped_enum_out_of_range) + << llvm::toString(Result.getInt(), 10) << Min.getZExtValue() + << Max.getZExtValue() << ED; } }