GNU bug report logs -
#11223
24.0.94; C++11 initializer lists cause wrong indentation
Previous Next
Reported by: Moritz Bunkus <moritz <at> bunkus.org>
Date: Wed, 11 Apr 2012 16:05:03 UTC
Severity: normal
Found in version 24.0.94
Fixed in version 24.5
Done: Alex <agrambot <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11223 in the body.
You can then email your comments to 11223 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11223
; Package
emacs
.
(Wed, 11 Apr 2012 16:05:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Moritz Bunkus <moritz <at> bunkus.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 11 Apr 2012 16:05:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
--
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds
Information forwarded
to
bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org
:
bug#11223
; Package
emacs,cc-mode
.
(Sun, 14 Aug 2016 21:19:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 11223 <at> debbugs.gnu.org (full text, mbox):
close 24.5
quit
Moritz Bunkus <moritz <at> 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.
bug marked as fixed in version 24.5, send any further explanations to
11223 <at> debbugs.gnu.org and Moritz Bunkus <moritz <at> bunkus.org>
Request was from
Alex <agrambot <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 14 Aug 2016 21:22:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 12 Sep 2016 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 345 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.