Subject: bug#24431: 25.1.50; Wrong indentation in C++ mode when calling constructors with braces

From: Alan Mackenzie <[email-masked]>
Date: 15 Sep 2016 08:42:34 -0000

Hello, Matthias

In article <[email-masked]> you wrote:

> Just type the following lines in a buffer with c++-mode enabled:

> struct line_t;
> struct point_t;

> void set_line(line_t);

> set_line(line_t(point_t(0.4, 0.2),
>                 point_t(0.2, 0.5)));

> set_line(line_t{point_t{0.4, 0.2},
>       point_t{0.2, 0.5}}); // wrong identation

What, exactly, is wrong about that indentation?  What would you like to
see there, and why?

When I do C-c C-s on that last line, I get:

    Syntactic analysis: ((arglist-cont-nonempty 130 138) (defun-block-intro 130) (statement-cont 130))

, which seems to be incorrect, since neither of the anchor points in the
last two of the three elements point at locations within the internal C++
constructs.  Amongst other things.

> In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9)
>  of 2016-08-27 built on carbon
> Repository revision: 1c7166a3ba399efbefc65feb8a6a41ef0dfa33a4
> Windowing system distributor 'The X.Org Foundation', version
> 11.0.11804000
> System Description:     Arch Linux

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).