all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Moritz Bunkus <moritz@bunkus.org>
Cc: 11223@debbugs.gnu.org
Subject: bug#11223: 24.0.94; C++11 initializer lists cause wrong indentation
Date: Sun, 14 Aug 2016 15:18:12 -0600	[thread overview]
Message-ID: <87wpjjoxrf.fsf@gmail.com> (raw)
In-Reply-To: <m34nsqo2rk.fsf@bunkus.org> (Moritz Bunkus's message of "Wed, 11 Apr 2012 14:45:51 +0200")

close 24.5
quit

Moritz Bunkus <moritz@bunkus.org> 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<int>{} << 42 << 54) }
>                                                   , whatever{"broken"}
>   {
>   }
> };
>
> class Foo: public QThingy {
> protected:
>   SomeObject thingy;
>   std::string whatever;
> public:
>   Foo()
>     : thingy( utilityFunction(42, QList<int> << 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.





      reply	other threads:[~2016-08-14 21:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-11 12:45 bug#11223: 24.0.94; C++11 initializer lists cause wrong indentation Moritz Bunkus
2016-08-14 21:18 ` Alex [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wpjjoxrf.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=11223@debbugs.gnu.org \
    --cc=moritz@bunkus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.