GNU bug report logs - #62841
CC Mode 5.35.2 (Group); Template indentation problems

Previous Next

Package: cc-mode;

Reported by: Michael Welsh Duggan <mwd <at> md5i.com>

Date: Fri, 14 Apr 2023 18:19:01 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Michael Welsh Duggan <mwd <at> md5i.com>
Cc: 62841 <at> debbugs.gnu.org
Subject: bug#62841: CC Mode 5.35.2 (Group); Template indentation problems
Date: Wed, 17 May 2023 16:14:39 +0000
[Message part 1 (text/plain, inline)]
Hello, Michael.

On Sun, Apr 23, 2023 at 13:44:29 +0000, Alan Mackenzie wrote:
> Thanks for the bug report.

> On Fri, Apr 14, 2023 at 14:18:16 -0400, Michael Welsh Duggan wrote:
> > Package: cc-mode

> > Package: cc-mode

> > Load the included file, bar.cpp:


> > template <typename T>
> > using value_variant=
> >   std::pair<
> >   std::variant<
> >     ipfix::octetArray_t,
> >     ipfix::unsigned8_t,
> >     ipfix::unsigned16_t,
> >     ipfix::unsigned32_t,
> >     ipfix::unsigned64_t,
> >     ipfix::signed8_t,
> >     ipfix::signed16_t,
> >     ipfix::signed32_t,
> >     ipfix::signed64_t,
> >     ipfix::float32_t,
> >     ipfix::float64_t,
> >     ipfix::boolean_t,
> >     ipfix::macAddress_t,
> >     ipfix::string_t,
> >     ipfix::dateTimeSeconds_t,
> >     ipfix::dateTimeMilliseconds_t,
> >     ipfix::dateTimeMicroseconds_t,
> >     ipfix::dateTimeNanoseconds_t,
> >     ipfix::ipv4Address_t,
> >     ipfix::ipv6Address_t,
> >     std::pair<ipfix::InfoElementID,std::vector<T>>,
> >     std::pair<ipfix::TemplateID,std::vector<std::vector<T>>>,
> >     std::pair<std::vector<
> >                 std::pair<
> >                   ipfix::TemplateID,
> >                   std::vector<std::vector<T>>>>>>,
> >   ipfix::length_t>;


> > For example:

> > emacs -Q /tmp/bar.cpp

> > Type:
> > C-x h C-M-\

> > First, note that std::variant is not indented with respect to std::pair.

I have amended the indentation logic, by introducing a new line-up
function, so this should be fixed, now.

> There are actually two distinct bugs in play, here.  Up till now I've
> been concentrating on the second one ....

> > Next, delete and re-insert the final angle bracket on the line that
> > reads:

> >     std::pair<ipfix::InfoElementID,std::vector<T>>,

> > Note the re-indention.

This, together with the other indentation problems, I hope are fixed,
too.

[ .... ]

Would you please test the enclosed patch, which should apply cleanly to
the Emacs master branch.  And then let me know whether there are any
problems with it.  Thanks!

Just, there might be unfound interactions between the template markers
and raw strings, but I hope not.

> > Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo =
> > version 1.16.0)
> >  of 2023-04-14
> > Package: CC Mode 5.35.2 (C++//l)
> > Buffer Style: gnu
> > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st=
> > ring-delim gen-comment-delim syntax-properties category-properties 1-bit)

> > -- 
> > Michael Welsh Duggan
> > (md5i <at> md5i.com)

-- 
Alan Mackenzie (Nuremberg, Germany).

[diff.20230517.diff (text/plain, attachment)]

This bug report was last modified 2 years and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.