From nobody Thu Jun 22 21:11:34 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 4QnCjM2FzCz4gfhg; Thu, 22 Jun 2023 21:11:35 +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 4QnCjM0CnSz4CsQ; Thu, 22 Jun 2023 21:11:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687468295; 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=0KjcAFdZqb7ELcqHLZZpkObOKPTPYZm8eSsxsy00j6Y=; b=eGO8MwbGLZuZTLG4z5rYPmBixG6fAo3/oAuQWJyef2MPVGDfQl+FmZaZtBcTmqtuD6hp/L dF4a56Nchk3To5P8VOp9YQ5glaJetOChFqY5i8PoStUzaaawCBBIAk3w678HQHKQjlJOrL Zj8l7XkveZA9Q+ayh36Oqv9jYkWuOjU6UWOrIB8yZslpN1mSdUM4WN+FzHivB8lMyp6x8R Qx2D3+31uFi9pKWNyXtan860eFg5jCQYG2iLuY6Peo/ajJRr+JhYaN3O7NOagpQ1cea8PX d2riI2exrVQWOPcW23BOAF/2C7Me8adB2vZMj9JPLisoGRrun+1bgcCVmkhtFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687468295; 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=0KjcAFdZqb7ELcqHLZZpkObOKPTPYZm8eSsxsy00j6Y=; b=xDdtbP3zZXh2Oxe/tI4Lok86O4TAtvA49QFMQaigdnAB0TOj0Tu5RY+b6b7U/HmHZ83fvu OFIszpvQNWDqJoH40yTKuKC2pu4/3k9cQ9jmj3/ITPeqFwfR/pYZ7Llqd9B0zv3Vv1Fyv+ yoQ79p7TUL7W2OPPS5uJZNn5rZNUMrInMqRV4PkAGu7eB5j3KRPLg+2R+PibcsGYUilYxh EZaHVDdemOlqvnhC3uPT8xN520fppvbSSa7ppf32faCM+5nfyaxps8tVwt9zi6Ep7A8iLJ +buUrGa+ZQ9FeNGeWO5pzNeesunj9/DLdke4aFoBVO2xVn030Cy7u4K5ERYEGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687468295; a=rsa-sha256; cv=none; b=PsNvMk3tqL7GaIUXDykNJFpJXBlaiaIKJQ/p1YC4+KsjQUeHTrkAT2i8F4KHb0GjGYH1n7 0XjKIaToOXf2KxUwGdhSobOunl7I6O97UwaE54wSivK2PjKo493YBch4mpAXUnmfaMgZj0 3IhdJsBZeaJklRXCrugctkS9uoil/Jr5tqfVUdd3bgw+c0TzR6R/WZS/06DC/AF+Daj9tK 0nzPWzq53NG6CAyWg2ISIY6/+24KiAurPmqXSJCTz8pzmmxWDPy7eORkhSjXiWGcOI3GAG FQ3CIzP4smzQeInZR6PB0/IcsjDG6lDBPqkm8ae0yKf8AVaxlaP8BbWX0yDYHA== 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 4QnCjL6M1Szdx9; Thu, 22 Jun 2023 21:11:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35MLBYPD067328; Thu, 22 Jun 2023 21:11:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35MLBYJ3067327; Thu, 22 Jun 2023 21:11:34 GMT (envelope-from git) Date: Thu, 22 Jun 2023 21:11:34 GMT Message-Id: <202306222111.35MLBYJ3067327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: cf24393421ca - main - 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/main X-Git-Reftype: branch X-Git-Commit: cf24393421ca807899c599a53ddc5dcedb7c71dc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=cf24393421ca807899c599a53ddc5dcedb7c71dc commit cf24393421ca807899c599a53ddc5dcedb7c71dc Author: Dimitry Andric AuthorDate: 2023-06-14 18:49:59 +0000 Commit: Dimitry Andric CommitDate: 2023-06-22 18:22:54 +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 --- .../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; } }