GNU bug report logs -
#23610
25.0.94; c++-mode doesn't fontify typename... like typename
Previous Next
Reported by: Ivan Andrus <darthandrus <at> gmail.com>
Date: Tue, 24 May 2016 17:02:02 UTC
Severity: minor
Found in version 25.0.94
Done: Alan Mackenzie <acm <at> muc.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello, Ivan.
On Wed, Jun 22, 2016 at 09:22:01AM -0600, Ivan Andrus wrote:
> On Sun, Jun 19, 2016 at 3:14 PM, Alan Mackenzie <acm <at> muc.de> wrote:
> > In article <mailman.202.1464109329.1216.bug-gnu-emacs <at> gnu.org> you wrote:
> >> Starting with emacs -Q, Y is not fontified in the snippet below, whereas
> >> X is.
> >> -Ivan
> >> template <typename X, typename... Y>
> >> class bob {
> >> };
> > [ .... ]
> > The following patch is a first attempt to fontify parameter packs. After
> > applying it, please be sure either to recompile CC Mode entirely, or
> > first to compile cc-langs.el (which contains macros), and then all three
> > of cc-fonts.el, cc-engine.el, and cc-mode.el.
> > It seems to fontify the "Y" above OK. I've tried it on a stock example
> > out of Wikipedia, and that works. Could you try it out on your code,
> > please, and let me know how well it works.
> It looks pretty good. I didn't notice this before, but the following example
> from Wikipedia is fontified differently if the ... is removed from before the
> `args`. In that case args is fontified with `font-lock-variable-name-face`.
> template<typename... Args> inline void expand(Args&&... args) {
> pass( some_function(args)... );
> }
What is this "&&" operator? It cannot be a logical and, and doesn't look
like anything to do with a move constructor. I've tried, and failed, to
find an explanation in http://en.cppreference.com/w/cpp/language. I
didn't find and explanation in the article "variadic templates" in
wikipedia either. A pointer to a web page explaining it would be much
appreciated.
I'm tempted to commit the patch as it is at the moment, but feel I ought
to understand this "&&" first.
> FWIW, I've seen similar mis-fontifications before (without ...) and it hasn't
> bothered me too much. I just found a reproducible case, so I guess I'll
> open a bug for it.
> Thanks for working on this. The raw string support is awesome!
Thanks! There've recently been one or two bugs fixed for raw string
support. The corrections are in the Emacs master branch.
> -Ivan
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 8 years and 307 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.