From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#11223: 24.0.94; C++11 initializer lists cause wrong indentation Date: Sun, 14 Aug 2016 15:18:12 -0600 Message-ID: <87wpjjoxrf.fsf@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1471209561 15439 195.159.176.226 (14 Aug 2016 21:19:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Aug 2016 21:19:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 11223@debbugs.gnu.org To: Moritz Bunkus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 14 23:19:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ2oO-0003kN-JT for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 23:19:16 +0200 Original-Received: from localhost ([::1]:33768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZ2oL-0007TQ-Lm for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 17:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZ2oF-0007Ru-51 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 17:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZ2oA-00038x-3e for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 17:19:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZ2o9-00038g-Vx; Sun, 14 Aug 2016 17:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bZ2o9-0001K7-Jy; Sun, 14 Aug 2016 17:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 14 Aug 2016 21:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11223 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 11223-submit@debbugs.gnu.org id=B11223.14712095015028 (code B ref 11223); Sun, 14 Aug 2016 21:19:01 +0000 Original-Received: (at 11223) by debbugs.gnu.org; 14 Aug 2016 21:18:21 +0000 Original-Received: from localhost ([127.0.0.1]:57612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ2nV-0001Ix-JW for submit@debbugs.gnu.org; Sun, 14 Aug 2016 17:18:21 -0400 Original-Received: from mail-it0-f53.google.com ([209.85.214.53]:37043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZ2nU-0001Ie-67; Sun, 14 Aug 2016 17:18:20 -0400 Original-Received: by mail-it0-f53.google.com with SMTP id f6so29914006ith.0; Sun, 14 Aug 2016 14:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Gb3agmzV6VHEQA3PKLNt/bFxGQBa/++36PEyhFxHGi4=; b=YmOMSW5wK5Ey7HsyOUgybt9PoHjfvFGkpOEgeNEDdivJTY4H0xu3fQtZ99Smr778yb QI0DeBGUW/NXOg1Zp0c1j0Y1BXgJ9/SKbJnrpq55xSr9aXEMsycivzfTGMRvkRLUEzw5 SbF9WenSvO4Bl+DPWBdjIZ5CB9xMG9Mj4n6wSL5l12exGCRlSIZeALcYTzdEhVxSV3Xr ZCDAFux+UWc49h8BkYf+gccIAHGaxq4Nvp6XSiGAzcXFrgQgKhGxM1KKwCz15/FVGjVT 0om7a+pbmMlmaldUbxH6ZFDnFYi0U3JXKxpw3EsNYqsjhKhPeDjwYcQ2L72QRz1oSwH/ 6bPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Gb3agmzV6VHEQA3PKLNt/bFxGQBa/++36PEyhFxHGi4=; b=U2f7xRTIL//rw+IVhkVa+fh4RHO++1HVVVaNEbYnDDdEw9qCe5xt10FIUOV3KtjRtr +0vvyCsNVuTUVnDG/ebdKW4zqKsUoaSUTgmwm+YKtNASss/Bc0BthH9VfUts6op7pl/u nkbwHOzUSBKHFeEo5Y+DR8tEn8+YOkiz4OYb1IBe07XaX4Ol+wLLhyHgEcQ72hZcF6w3 9b9O88Dc65RKrCel+DigkOdJ+kfHabdi19wLd8Ctx4ZonSvmSjuaeGB654YvIEjlb1e3 WkLfTXvhK8yz9BLECXOw+sfpGP4uo694B59BHiwLpYV9tZ7k3sVNaMA8TjwvajNEJsXk AQPw== X-Gm-Message-State: AEkoous659PTB0UCWX/cRhlqpoTWvIOq7WmLIVFz4U/Rukw4tP1Vr5UvWddHaXDIH1apng== X-Received: by 10.36.253.194 with SMTP id m185mr10652884ith.2.1471209494559; Sun, 14 Aug 2016 14:18:14 -0700 (PDT) Original-Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id t35sm8442411ioi.7.2016.08.14.14.18.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Aug 2016 14:18:14 -0700 (PDT) In-Reply-To: (Moritz Bunkus's message of "Wed, 11 Apr 2012 14:45:51 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122218 Archived-At: close 24.5 quit Moritz Bunkus writes: > C++11 introduces the use of { } as object initializer lists instead of > the usual ( ). Using them often causes Emacs & cc-mode to use very > strange indentation. One example is below. > > Tested both with c-version 5.32.2 and 5.33. > > How to reproduce: > > Save the text between the ===== lines into a file, e.g. "test.cc". Start > Emacs with or without -Q on the file. Select the whole buffer, run > `indent-region`. > > ============================================================ > class Foo: public QThingy { > protected: > SomeObject thingy; > std::string whatever; > public: > Foo() > : thingy{ utilityFunction(42, QList{} << 42 << 54) } > , whatever{"broken"} > { > } > }; > > class Foo: public QThingy { > protected: > SomeObject thingy; > std::string whatever; > public: > Foo() > : thingy( utilityFunction(42, QList << 42 << 54) ) > , whatever( "working" ) > { > } > }; > ============================================================ > > In GNU Emacs 24.0.94.1 (x86_64-pc-linux-gnu, GTK+ Version 3.2.0) > of 2012-03-19 on rhenium, modified by Debian Both the top and bottom classes appear to indent correctly in Emacs 24.5.