From unknown Fri Aug 15 02:02:57 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69293 <69293@debbugs.gnu.org> To: bug#69293 <69293@debbugs.gnu.org> Subject: Status: 30.0.50; cc-mode doesn't support "if consteval" Reply-To: bug#69293 <69293@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:02:57 +0000 retitle 69293 30.0.50; cc-mode doesn't support "if consteval" reassign 69293 emacs submitter 69293 Herman, G=C3=A9za severity 69293 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 20 15:22:06 2024 Received: (at submit) by debbugs.gnu.org; 20 Feb 2024 20:22:06 +0000 Received: from localhost ([127.0.0.1]:46765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcWcv-0003dz-Ib for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:22:06 -0500 Received: from lists.gnu.org ([209.51.188.17]:48264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcWcs-0003dY-Hd for submit@debbugs.gnu.org; Tue, 20 Feb 2024 15:22:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcWcV-0005NR-1E for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 15:21:39 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcWcS-0008Fn-8y for bug-gnu-emacs@gnu.org; Tue, 20 Feb 2024 15:21:38 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a3ed9cae56fso317313266b.1 for ; Tue, 20 Feb 2024 12:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708460494; x=1709065294; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=rbCGJA9nZSEYGzcRWF70sEO26y2ZgmS/twRWvcL0c4g=; b=bCElpeqpCbjcIclyp80FjGtQ9NFaEGC5FlPcSpPbd/BXM2N13fdFb2gd9WCholXa/j gf67s/j1EOQVZdfU4D1f2Fs4zCxR9vX0LFESpwxLve9pDMEuCUBgYPykG09eZu7h2AFH uj8YmISHC08l4NQEH6Wa9zGPAD5B54ZtJj5u+cslHVnezlIt7HgMUiWzDSVNqIfm4Xu+ pZcZVmMkBF9tCtqEbFPGpiMF2E9flFFFyKDnpjOAhXzutCFbz6cdqzY/uOaAbFQFUk+S lvCcfw+j4O3HIF4UKHN6n5zujF7vS5Ftd1Aq5lvJnkC5j6Vea2oVcSQpSbaYyAA80H+U T37g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708460494; x=1709065294; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rbCGJA9nZSEYGzcRWF70sEO26y2ZgmS/twRWvcL0c4g=; b=frpkgfuxu5E8AB3RGAB+E+LqthHGyt3joomP4SFpKMTkRsd5LUpRP9ekiPvNl0p+FN k0VJt1Fin7NOaO5cY8aWVgTg80x8u3lwLmsn1rQsnV9v2MaPJrSD/1VHs+bXUvq5ipuV cIcZViVJOVfchG23H3L72M4N9/BD8UfnmASK5RDEVxfK5YJ8NlGo2fik7csy+TcCDsGg /RzUi9Pr2q2b5T+/Hvr9BBdv+cNM2TPJ0vQTNTNC36L/CTHGa4uoFCzs7P7v0L6Cm9BI ehJGDc6d1cP+jteeHhjsJO9k7eIn+U8hI/cIutpbLJYKtCJDG2KXzBmHKE6p2G3CbuPY YEsA== X-Gm-Message-State: AOJu0Yx5k9aX7O3K7zfPCWGIlL35ghLk8LMdzJNO2LiGaBDwnGdkcmIL mtwuWYZR0kfI8WC0ZOd1Vitty930RtiyXpVJ+FyLbV0CNUj4wSzg2zvPp7KpQwY= X-Google-Smtp-Source: AGHT+IGzOFcToaG+AspoxOwl8IIcNhd85yulIGaLs6zKaCq9XZzWYwXhTeJdiv6fZu1EoBAF5w9sxQ== X-Received: by 2002:a17:907:20e2:b0:a3e:9df3:b2e7 with SMTP id rh2-20020a17090720e200b00a3e9df3b2e7mr5508266ejb.35.1708460493825; Tue, 20 Feb 2024 12:21:33 -0800 (PST) Received: from localhost (62-77-231-86.static.invitel.hu. [62.77.231.86]) by smtp.gmail.com with ESMTPSA id tb27-20020a1709078b9b00b00a3e502f5d3dsm3328119ejc.60.2024.02.20.12.21.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 12:21:33 -0800 (PST) From: =?utf-8?Q?Herman=2C_G=C3=A9za?= To: bug-gnu-emacs@gnu.org Subject: 30.0.50; cc-mode doesn't support "if consteval" Date: Tue, 20 Feb 2024 21:21:27 +0100 Message-ID: <877ciyga48.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=geza.herman@gmail.com; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.5 (----) C++ has a new feature, "if consteval". So one can write code like if consteval { // do something } else { // do something else } The problem is that cc-mode doesn't recognize this construct, lines are not indented correctly: the "// do something" and the "} else {" receive an additional level of indentation. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.18.0) of 2023-11-29 built on okoska Repository revision: 47837b3863deba274f16960f1ee9fde4acb9d5a1 Repository branch: my-modifications Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Debian GNU/Linux trixie/sid Configured using: 'configure --with-native-compilation --without-compress-install --without-gconf --without-gsettings --without-dbus --with-small-ja-dic --with-json --with-xinput2 --with-x-toolkit=no --with-tree-sitter --with-cairo --with-cairo-xcb --disable-silent-rules 'CFLAGS=-mtune=native -march=native -g3 -O3'' Configured features: ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY OLDXMENU PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB Important settings: value of $LC_ALL: C.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: magit-todos-mode: t git-identity-magit-mode: t global-git-commit-mode: t vertico-multiform-mode: t recentf-mode: t which-key-mode: t global-auto-revert-mode: t global-undo-tree-mode: t undo-tree-mode: t savehist-mode: t ws-butler-global-mode: t ws-butler-mode: t diff-hl-flydiff-mode: t global-diff-hl-mode: t clean-aindent-mode: t global-whitespace-mode: t projectile-mode: t marginalia-mode: t vertico-mode: t global-anzu-mode: t anzu-mode: t global-evil-matchit-mode: t evil-matchit-mode: t evil-snipe-override-mode: t evil-snipe-mode: t evil-snipe-override-local-mode: t evil-snipe-local-mode: t global-evil-surround-mode: t evil-surround-mode: t global-evil-visualstar-mode: t evil-visualstar-mode: t better-jumper-mode: t better-jumper-local-mode: t evil-leader-mode: t global-evil-leader-mode: t global-hl-todo-mode: t winum-mode: t hes-mode: t gcmh-mode: t global-page-break-lines-mode: t evil-mode: t evil-local-mode: t save-place-mode: t override-global-mode: t minibuffer-depth-indicate-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-history-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t abbrev-mode: t Load-path shadows: /home/geza/.emacs.d/elpa/transient-20240201.1100/transient hides /usr/local/share/emacs/30.0.50/lisp/transient ~/.emacs.d/lisp/emacs-gdb/gdb-mi hides /usr/local/share/emacs/30.0.50/lisp/progmodes/gdb-mi Features: (shadow sort mail-extr evil-collection-magit evil-collection-forge forge-list forge-commands forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub url-http url-gw nsm url-auth let-alist gnutls forge-notify forge-revnote forge-pullreq forge-issue forge-topic yaml parse-time iso8601 bug-reference forge-post markdown-mode edit-indirect color noutline outline forge-repo forge forge-core forge-db closql emacsql-sqlite-common emacsql emacsql-compiler eieio-base magit-todos pcre2el rxt re-builder async magit-tbdiff git-identity vdiff-magit magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util vdiff magit-bookmark magit-autoloads magit-submodule magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-handlers url-parse auth-source json map url-vars magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff hydra lv smerge-mode git-commit log-edit add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor shell pcomplete server magit-mode transient magit-git magit-base magit-section format-spec crm emacsbug message mailcap yank-media puny evil-collection-dired dired-git-info peep-dired dired-narrow delsel dired-filter f s dired-aux dired-x dired-subtree dired-hacks-utils evil-collection-wdired wdired ls-lisp dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util cursor-sensor evil-collection-consult consult-dir vertico-multiform consult-compile recentf tree-widget wid-edit shut-up consult bookmark pp face-remap drag-stuff which-key autorevert filenotify undo-tree queue savehist bm evil-collection-info info ws-butler diff-hl-flydiff diff diff-hl log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode clean-aindent-mode column-enforce-mode whitespace projectile project lisp-mnt evil-collection-wgrep wgrep evil-collection-grep grep compile text-property-search evil-collection-comint comint ansi-osc ansi-color ibuf-ext ibuffer ibuffer-loaddefs orderless marginalia vertico anzu evil-matchit evil-matchit-evil-setup evil-matchit-sdk semantic/lex semantic/fw eieio eieio-core mode-local find-func evil-exchange evil-args evil-indent-plus evil-textobj-line evil-textobj-entire evil-textobj-column evil-textobj-anyblock evil-snipe evil-surround evil-mc evil-mc-command-execute evil-mc-command-record evil-mc-cursor-make evil-mc-region evil-mc-cursor-state evil-mc-undo evil-mc-vars evil-mc-known-commands evil-mc-common avy evil-visualstar evil-collection-simple evil-collection-replace evil-collection annalist better-jumper pcase cl-macs evil-leader hl-todo compat hl-line transpose-frame winum dash ov highlight-escape-sequences gcmh page-break-lines evil evil-integration evil-maps evil-commands reveal evil-jumps evil-command-window evil-types evil-search evil-ex evil-macros evil-repeat evil-states evil-core evil-common thingatpt rect evil-vars ring edmacro kmacro byte-opt saveplace bind-key easy-mmode advice mb-depth comp cl-seq comp-cstr cl-extra help-mode warnings icons subr-x gv cl-loaddefs cl-lib bytecomp byte-compile comp-run comp-common rx jka-compr rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads inotify lcms2 dynamic-setting font-render-setting cairo xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 618221 566082) (symbols 48 34440 269) (strings 32 284048 52426) (string-bytes 1 13838690) (vectors 16 75118) (vector-slots 8 1319006 1056891) (floats 8 400 2175) (intervals 56 912 295) (buffers 992 12)) From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 22 09:33:02 2024 Received: (at 69293) by debbugs.gnu.org; 22 Feb 2024 14:33:02 +0000 Received: from localhost ([127.0.0.1]:58526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdA8D-0006XD-5y for submit@debbugs.gnu.org; Thu, 22 Feb 2024 09:33:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdA88-0006W2-GL for 69293@debbugs.gnu.org; Thu, 22 Feb 2024 09:32:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rd8y8-0001kr-4Z; Thu, 22 Feb 2024 08:18:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=R0RM0pof4wddhbRjoQ2I9vqVFN32a7YlRKrbHrJ/SaA=; b=rfg1doXK0oaBsAOaT9Y3 cf23mtF8V77u333H3NbWNzdbmoijLN3yJwopAzdjjiwmIxRSpireGSeG04rBXoPtSQP5dP+iI2auJ XsAKigw5yYX3T2aPv2ILdyKajRB9Urq2/2Oh8nAQvMqiiD+afpZj5luUt9Gm0hQwaT+6O3CNpQlt4 sBdTiAXggMx4LoiILPKOCO+Pm8NebJ6i6FGyPt6vbcMgNteq5Kls7kz1yYZBpIR7QJZ58nmZRlnnX tfWDINgIx+fiCprW/g0IXkMvdQ2Th7ygxt7zTzC4uhdht11bWTYWptVJ+axoa9nBFSWoAnbt5TZbv iz9/Ux7a1et/fQ==; Date: Thu, 22 Feb 2024 15:18:28 +0200 Message-Id: <86zfvs1vtn.fsf@gnu.org> From: Eli Zaretskii To: Herman@debbugs.gnu.org, =?iso-8859-1?Q?G=E9za?= , Alan Mackenzie In-Reply-To: <877ciyga48.fsf@gmail.com> (Herman@debbugs.gnu.org) Subject: Re: bug#69293: 30.0.50; cc-mode doesn't support "if consteval" References: <877ciyga48.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 69293 Cc: 69293@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) > From: Herman@debbugs.gnu.org, Géza > Date: Tue, 20 Feb 2024 21:21:27 +0100 > > > C++ has a new feature, "if consteval". So one can write code like > > if consteval { > // do something > } else { > // do something else > } > > The problem is that cc-mode doesn't recognize this construct, lines > are not indented correctly: the "// do something" and the "} else {" > receive an additional level of indentation. Alan, could you please look into this? From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 25 11:59:57 2024 Received: (at 69293) by debbugs.gnu.org; 25 Feb 2024 16:59:57 +0000 Received: from localhost ([127.0.0.1]:59425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reHr2-0004fk-N7 for submit@debbugs.gnu.org; Sun, 25 Feb 2024 11:59:56 -0500 Received: from mail.muc.de ([193.149.48.3]:52737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reHqz-0004fA-N1 for 69293@debbugs.gnu.org; Sun, 25 Feb 2024 11:59:54 -0500 Received: (qmail 80001 invoked by uid 3782); 25 Feb 2024 17:52:41 +0100 Received: from acm.muc.de (pd953a142.dip0.t-ipconnect.de [217.83.161.66]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 25 Feb 2024 17:52:41 +0100 Received: (qmail 32487 invoked by uid 1000); 25 Feb 2024 16:52:40 -0000 Date: Sun, 25 Feb 2024 16:52:40 +0000 To: Eli Zaretskii Subject: Re: bug#69293: 30.0.50; cc-mode doesn't support "if consteval" Message-ID: References: <877ciyga48.fsf@gmail.com> <86zfvs1vtn.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <86zfvs1vtn.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69293 Cc: 69293@debbugs.gnu.org, =?iso-8859-1?Q?G=E9za?= , Herman@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Eli. On Thu, Feb 22, 2024 at 15:18:28 +0200, Eli Zaretskii wrote: > > From: Herman@debbugs.gnu.org, Géza > > Date: Tue, 20 Feb 2024 21:21:27 +0100 > > C++ has a new feature, "if consteval". So one can write code like > > if consteval { > > // do something > > } else { > > // do something else > > } > > The problem is that cc-mode doesn't recognize this construct, lines > > are not indented correctly: the "// do something" and the "} else {" > > receive an additional level of indentation. > Alan, could you please look into this? Yes, I will. Thanks for the forwarding! -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 22 09:35:15 2024 Received: (at 69293) by debbugs.gnu.org; 22 Mar 2024 13:35:15 +0000 Received: from localhost ([127.0.0.1]:52723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnf3C-0005xl-DZ for submit@debbugs.gnu.org; Fri, 22 Mar 2024 09:35:15 -0400 Received: from mail.muc.de ([193.149.48.3]:20438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnf3A-0005xO-Ea for 69293@debbugs.gnu.org; Fri, 22 Mar 2024 09:35:13 -0400 Received: (qmail 90765 invoked by uid 3782); 22 Mar 2024 14:34:25 +0100 Received: from acm.muc.de (p4fe15d8f.dip0.t-ipconnect.de [79.225.93.143]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 22 Mar 2024 14:34:25 +0100 Received: (qmail 9763 invoked by uid 1000); 22 Mar 2024 13:34:24 -0000 Date: Fri, 22 Mar 2024 13:34:24 +0000 To: Herman@acm.muc.de, =?iso-8859-1?Q?G=E9za?= Subject: Re: bug#69293: 30.0.50; cc-mode doesn't support "if consteval" Message-ID: References: <877ciyga48.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <877ciyga48.fsf@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69293 Cc: acm@muc.de, 69293@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Géza. Sorry it's taken a long time to respond. I've been unwell. On Tue, Feb 20, 2024 at 21:21:27 +0100, Herman wrote: > C++ has a new feature, "if consteval". So one can write code like > if consteval { > // do something > } else { > // do something else > } Yes, indeed. Maybe I'm the only person to think so, but I think it's a horrible distortion of C syntax. Anyway ... > The problem is that cc-mode doesn't recognize this construct, lines > are not indented correctly: the "// do something" and the "} else {" > receive an additional level of indentation. Would you please try out the patch below on your Emacs, then byte compile CC Mode in its entirety (there are new macros) then load it into a running Emacs (or restart Emacs). cc-mode is in .../lisp/progmodes. Then please let me know how well it fixes the bug. Thanks! > In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version > 1.18.0) of 2023-11-29 built on okoska > Repository revision: 47837b3863deba274f16960f1ee9fde4acb9d5a1 > Repository branch: my-modifications > Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 > System Description: Debian GNU/Linux trixie/sid [ .... ] diff -r 779141971296 cc-engine.el --- a/cc-engine.el Sun Dec 31 10:45:58 2023 +0000 +++ b/cc-engine.el Fri Mar 22 12:54:39 2024 +0000 @@ -12365,13 +12365,21 @@ (zerop (c-backward-token-2 1 t lim)) t) (or (looking-at c-block-stmt-1-key) - (and (eq (char-after) ?\() - (zerop (c-backward-token-2 1 t lim)) - (if (looking-at c-block-stmt-hangon-key) - (zerop (c-backward-token-2 1 t lim)) - t) - (or (looking-at c-block-stmt-2-key) - (looking-at c-block-stmt-1-2-key)))) + (or + (and + (eq (char-after) ?\() + (zerop (c-backward-token-2 1 t lim)) + (if (looking-at c-block-stmt-hangon-key) + (zerop (c-backward-token-2 1 t lim)) + t) + (or (looking-at c-block-stmt-2-key) + (looking-at c-block-stmt-1-2-key))) + (and (looking-at c-paren-clause-key) + (zerop (c-backward-token-2 1 t lim)) + (if (looking-at c-negation-op-re) + (zerop (c-backward-token-2 1 t lim)) + t) + (looking-at c-block-stmt-with-key)))) (point)))) (defun c-after-special-operator-id (&optional lim) diff -r 779141971296 cc-langs.el --- a/cc-langs.el Sun Dec 31 10:45:58 2023 +0000 +++ b/cc-langs.el Fri Mar 22 12:54:39 2024 +0000 @@ -1583,6 +1583,12 @@ (c-lang-defvar c-assignment-op-regexp (c-lang-const c-assignment-op-regexp)) +(c-lang-defconst c-negation-op-re + ;; Regexp matching the negation operator. + t "!\\([^=]\\|$\\)") + +(c-lang-defvar c-negation-op-re (c-lang-const c-negation-op-re)) + (c-lang-defconst c-arithmetic-operators "List of all arithmetic operators, including \"+=\", etc." ;; Note: in the following, there are too many operators for AWK and IDL. @@ -3149,6 +3155,30 @@ (c-lang-const c-block-stmt-2-kwds))))) (c-lang-defvar c-opt-block-stmt-key (c-lang-const c-opt-block-stmt-key)) +(c-lang-defconst c-paren-clause-kwds + "Keywords which can stand in the place of paren sexps in conditionals. +This applies only to conditionals in `c-block-stmt-with-kwds'." + t nil + c++ '("consteval")) + +(c-lang-defconst c-paren-clause-key + ;; Regexp matching a keyword in `c-paren-clause-kwds'. + t (c-make-keywords-re t + (c-lang-const c-paren-clause-kwds))) +(c-lang-defvar c-paren-clause-key (c-lang-const c-paren-clause-key)) + +(c-lang-defconst c-block-stmt-with-kwds + "Statement keywords which can be followed by a keyword instead of a parens. +Such a keyword is a member of `c-paren-clause-kwds." + t nil + c++ '("if")) + +(c-lang-defconst c-block-stmt-with-key + ;; Regexp matching a keyword in `c-block-stmt-with-kwds'. + t (c-make-keywords-re t + (c-lang-const c-block-stmt-with-kwds))) +(c-lang-defvar c-block-stmt-with-key (c-lang-const c-block-stmt-with-key)) + (c-lang-defconst c-simple-stmt-kwds "Statement keywords followed by an expression or nothing." t '("break" "continue" "goto" "return") -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 25 13:15:43 2024 Received: (at 69293) by debbugs.gnu.org; 25 Mar 2024 17:15:43 +0000 Received: from localhost ([127.0.0.1]:36098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ronvC-00065U-TS for submit@debbugs.gnu.org; Mon, 25 Mar 2024 13:15:43 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]:51280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ronv9-00065D-Uq for 69293@debbugs.gnu.org; Mon, 25 Mar 2024 13:15:42 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a46f0da1b4fso591599366b.2 for <69293@debbugs.gnu.org>; Mon, 25 Mar 2024 10:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711386934; x=1711991734; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:references:from:to:cc:subject:date:message-id :reply-to; bh=sDQD9hDZD93dI5hxqsTADYYGwaCoWpIQ36lLq1FdcA8=; b=LmgjQp2sCVw77ANz75D67kCHDzwJWT5EoYl3Zf2mfuGxNiJeEK1wtYK0A+j2YNH35S muphtLy4UfmIoRl2/pRmJTgiED8p3HoNkBUsZBInJccnd4uq3Wi0ci+ansEkmhzg+Hjj xaLOtNtwQEKbcjuAz1LfxJIcewkFFrNMfq6+IE6K9hSqSfYilp9V/21rKq6qzmKOypbi i7peQg8t4NrQNCoCYeEnJbDbLXuFhkGJOYjKSRdI2kZVv+5ufQJfmR28ewxHhOGiA1hv jWbC8KByaza4NhJVa3Rk64OG0MmwDtKKS41rk3MLI1lOoA0Ig4jWziU8+Z4UC5oh1jIL A4iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711386934; x=1711991734; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:references:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=sDQD9hDZD93dI5hxqsTADYYGwaCoWpIQ36lLq1FdcA8=; b=qy4nhvAnXDdh2Fb512IWVNe7PSZmjgyErdABtg0l89exA6G73qdZOA4XFEIk6KQV2O govjnZIuRk9wRBVDsUlED06Qzz9YloGQ9hGG72rw+PFDHfJdzJabFfSHffTg515gSiSu UfTqfyUZL0Ea/Z1/+BSzp3wEcSNHOSmhuY4e9lljBtof61Es61Q4BOTWx2VftErQYZcV dEWE030N0f/F31LO3Qsoy2XaHdqktM/q/Xf/ALPJtxvlf8ifC5G1N/sE29f5zmIayo7h rtcWyvkZTKrZfxnm9OLcM4CtmWoRpGqfTWpQcH1nFpIacOKlilDAX1iSblX2QVTGGBd5 J23Q== X-Gm-Message-State: AOJu0Yy0l7nvXe/2lKhI6IV/MOf7IoT3+MI3wY5tKAVsMBBu5McwjtRs qiAzmbbZFVhow0ZZVb+h7t/km748Bc3kuI2XMIUY6xISfx7t+lo9QHlSoaS8 X-Google-Smtp-Source: AGHT+IHPFebJHkxYPp6R3JituOJEY2EkPnLFwd9BEyYasUFMuJfVjnmI0ln7Zx0C+lEHmtD/8ZNRPw== X-Received: by 2002:a17:907:d2a:b0:a47:f286:d9f8 with SMTP id gn42-20020a1709070d2a00b00a47f286d9f8mr2420959ejc.43.1711359674452; Mon, 25 Mar 2024 02:41:14 -0700 (PDT) Received: from localhost (netacc-gpn-204-42-119.pool.yettel.hu. [5.204.42.119]) by smtp.gmail.com with ESMTPSA id q5-20020a170906388500b00a473362062fsm2850001ejd.220.2024.03.25.02.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 02:41:13 -0700 (PDT) References: <877ciyga48.fsf@gmail.com> From: =?utf-8?Q?Herman=2C_G=C3=A9za?= To: Alan Mackenzie Subject: Re: bug#69293: 30.0.50; cc-mode doesn't support "if consteval" Date: Mon, 25 Mar 2024 10:37:14 +0100 In-reply-to: Message-ID: <87frwe7io7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 69293 Cc: 69293@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Alan, I agree, "if consteval" looks weird indeed. With your patch, "if consteval" indents correctly. I used cc-mode=20 with your patch for a day, haven't noticed any newly introduced=20 bugs. Thank you, and get better! G=C3=A9za Alan Mackenzie writes: > Hello, G=C3=A9za. > > Sorry it's taken a long time to respond. I've been unwell. > > On Tue, Feb 20, 2024 at 21:21:27 +0100, Herman wrote: > >> C++ has a new feature, "if consteval". So one can write code=20 >> like > >> if consteval { >> // do something >> } else { >> // do something else >> } > > Yes, indeed. Maybe I'm the only person to think so, but I think=20 > it's a > horrible distortion of C syntax. Anyway ... > >> The problem is that cc-mode doesn't recognize this construct,=20 >> lines >> are not indented correctly: the "// do something" and the "}=20 >> else {" >> receive an additional level of indentation. > > Would you please try out the patch below on your Emacs, then=20 > byte > compile CC Mode in its entirety (there are new macros) then load=20 > it into > a running Emacs (or restart Emacs). cc-mode is in=20 > .../lisp/progmodes. > > Then please let me know how well it fixes the bug. Thanks! > >> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo=20 >> version >> 1.18.0) of 2023-11-29 built on okoska >> Repository revision: 47837b3863deba274f16960f1ee9fde4acb9d5a1 >> Repository branch: my-modifications >> Windowing system distributor 'The X.Org Foundation', version=20 >> 11.0.12101008 >> System Description: Debian GNU/Linux trixie/sid > > [ .... ] > > > > diff -r 779141971296 cc-engine.el > --- a/cc-engine.el Sun Dec 31 10:45:58 2023 +0000 > +++ b/cc-engine.el Fri Mar 22 12:54:39 2024 +0000 > @@ -12365,13 +12365,21 @@ > (zerop (c-backward-token-2 1 t lim)) > t) > (or (looking-at c-block-stmt-1-key) > - (and (eq (char-after) ?\() > - (zerop (c-backward-token-2 1 t lim)) > - (if (looking-at c-block-stmt-hangon-key) > - (zerop (c-backward-token-2 1 t lim)) > - t) > - (or (looking-at c-block-stmt-2-key) > - (looking-at c-block-stmt-1-2-key)))) > + (or > + (and > + (eq (char-after) ?\() > + (zerop (c-backward-token-2 1 t lim)) > + (if (looking-at c-block-stmt-hangon-key) > + (zerop (c-backward-token-2 1 t lim)) > + t) > + (or (looking-at c-block-stmt-2-key) > + (looking-at c-block-stmt-1-2-key))) > + (and (looking-at c-paren-clause-key) > + (zerop (c-backward-token-2 1 t lim)) > + (if (looking-at c-negation-op-re) > + (zerop (c-backward-token-2 1 t lim)) > + t) > + (looking-at c-block-stmt-with-key)))) > (point)))) > > (defun c-after-special-operator-id (&optional lim) > diff -r 779141971296 cc-langs.el > --- a/cc-langs.el Sun Dec 31 10:45:58 2023 +0000 > +++ b/cc-langs.el Fri Mar 22 12:54:39 2024 +0000 > @@ -1583,6 +1583,12 @@ > (c-lang-defvar c-assignment-op-regexp > (c-lang-const c-assignment-op-regexp)) > > +(c-lang-defconst c-negation-op-re > + ;; Regexp matching the negation operator. > + t "!\\([^=3D]\\|$\\)") > + > +(c-lang-defvar c-negation-op-re (c-lang-const=20 > c-negation-op-re)) > + > (c-lang-defconst c-arithmetic-operators > "List of all arithmetic operators, including \"+=3D\", etc." > ;; Note: in the following, there are too many operators for=20 > AWK and IDL. > @@ -3149,6 +3155,30 @@ > (c-lang-const c-block-stmt-2-kwds))))) > (c-lang-defvar c-opt-block-stmt-key (c-lang-const=20 > c-opt-block-stmt-key)) > > +(c-lang-defconst c-paren-clause-kwds > + "Keywords which can stand in the place of paren sexps in=20 > conditionals. > +This applies only to conditionals in `c-block-stmt-with-kwds'." > + t nil > + c++ '("consteval")) > + > +(c-lang-defconst c-paren-clause-key > + ;; Regexp matching a keyword in `c-paren-clause-kwds'. > + t (c-make-keywords-re t > + (c-lang-const c-paren-clause-kwds))) > +(c-lang-defvar c-paren-clause-key (c-lang-const=20 > c-paren-clause-key)) > + > +(c-lang-defconst c-block-stmt-with-kwds > + "Statement keywords which can be followed by a keyword=20 > instead of a parens. > +Such a keyword is a member of `c-paren-clause-kwds." > + t nil > + c++ '("if")) > + > +(c-lang-defconst c-block-stmt-with-key > + ;; Regexp matching a keyword in `c-block-stmt-with-kwds'. > + t (c-make-keywords-re t > + (c-lang-const c-block-stmt-with-kwds))) > +(c-lang-defvar c-block-stmt-with-key (c-lang-const=20 > c-block-stmt-with-key)) > + > (c-lang-defconst c-simple-stmt-kwds > "Statement keywords followed by an expression or nothing." > t '("break" "continue" "goto" "return") From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 26 17:12:49 2024 Received: (at 69293-done) by debbugs.gnu.org; 26 Mar 2024 21:12:49 +0000 Received: from localhost ([127.0.0.1]:35267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpE6D-0008Bg-D0 for submit@debbugs.gnu.org; Tue, 26 Mar 2024 17:12:49 -0400 Received: from mail.muc.de ([193.149.48.3]:37688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpE67-0008BM-BU for 69293-done@debbugs.gnu.org; Tue, 26 Mar 2024 17:12:47 -0400 Received: (qmail 73094 invoked by uid 3782); 26 Mar 2024 22:12:36 +0100 Received: from acm.muc.de (p4fe15213.dip0.t-ipconnect.de [79.225.82.19]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 26 Mar 2024 22:12:35 +0100 Received: (qmail 3670 invoked by uid 1000); 26 Mar 2024 21:12:34 -0000 Date: Tue, 26 Mar 2024 21:12:34 +0000 To: =?iso-8859-1?Q?Herman=2C_G=E9za?= Subject: Re: bug#69293: 30.0.50; cc-mode doesn't support "if consteval" Message-ID: References: <877ciyga48.fsf@gmail.com> <87frwe7io7.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87frwe7io7.fsf@gmail.com> X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69293-done Cc: 69293-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Géza. On Mon, Mar 25, 2024 at 10:37:14 +0100, Herman, Géza wrote: > Hi Alan, > I agree, "if consteval" looks weird indeed. > With your patch, "if consteval" indents correctly. I used cc-mode > with your patch for a day, haven't noticed any newly introduced > bugs. Thanks for doing the testing. I've now committed the patch and I'm closing the bug with this post. > Thank you, and get better! > Géza > Alan Mackenzie writes: [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Fri Aug 15 02:02:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 24 Apr 2024 11:25:55 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator