all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Ivan Andrus <darthandrus@gmail.com>
Cc: 23610@debbugs.gnu.org
Subject: bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename
Date: Thu, 30 Jun 2016 14:36:36 +0000	[thread overview]
Message-ID: <20160630143636.GD3082@acm.fritz.box> (raw)
In-Reply-To: <CA+R1CoxeJ8SSn-L4_U-=LYrA3zYS-i1oD+dh1sJF_RxYLxMuUQ@mail.gmail.com>

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@muc.de> wrote:
> > In article <mailman.202.1464109329.1216.bug-gnu-emacs@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).





  reply	other threads:[~2016-06-30 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 17:01 bug#23610: 25.0.94; c++-mode doesn't fontify typename... like typename Ivan Andrus
     [not found] ` <mailman.202.1464109329.1216.bug-gnu-emacs@gnu.org>
2016-05-30 12:57   ` Alan Mackenzie
2016-05-30 13:49     ` Óscar Fuentes
2016-05-30 15:25       ` Alan Mackenzie
2016-07-23 15:13     ` Alan Mackenzie
2016-06-19 21:14   ` Alan Mackenzie
2016-06-22 15:22     ` Ivan Andrus
2016-06-30 14:36       ` Alan Mackenzie [this message]
2016-06-30 15:10         ` John Yates
2016-06-30 16:47           ` Alan Mackenzie
2016-06-30 17:24       ` Alan Mackenzie

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=20160630143636.GD3082@acm.fritz.box \
    --to=acm@muc.de \
    --cc=23610@debbugs.gnu.org \
    --cc=darthandrus@gmail.com \
    /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.