From: Daniel Colascione <dancol@dancol.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 7579@debbugs.gnu.org, Chong Yidong <cyd@gnu.org>,
Daniel Colascione <dan.colascione@gmail.com>
Subject: bug#7579: cc-mode c++ template-typed variable decl regression
Date: Tue, 14 Feb 2012 09:16:25 -0800 [thread overview]
Message-ID: <4F3A96E9.8090507@dancol.org> (raw)
In-Reply-To: <20120214161153.GC15736@acm.acm>
[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]
Hi Alan,
On 2/14/12 8:11 AM, Alan Mackenzie wrote:
>>>> /* In Emacs 23, adffdfa below is fontified as a variable. In Emacs HEAD,
>>>> it is not. */
>
>>>> void foo()
>>>> {
>>>> mumble x(5);
>>>> std::vector<int> adffdfa(1,2,3);
>>>> };
>
>> Are there any syntactic clues here that a variable rather than a function
>> is being declared? All I can see is that numeric literals take the place
>> of "parameters".
>
> Please ignore this request. Obviously, for a function, there must be
> either nothing in the parentheses or [<type> <value>]*.
Or just types:
std::vector <int> blah(int);
typedef int foo;
std::vector <int> blah(foo);
Still, unless we're absolutely sure we're looking at a function
declaration, we should fontify a declaration as a variables
declaration. Function-scope function declarations are extremely
uncommon, and at least in my experience, almost always offset by
keywords like "extern". Even if something like int bar(); could be a
function, fontifying it as a variable would be the right thing to do
in function scope for C++.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 235 bytes --]
next prev parent reply other threads:[~2012-02-14 17:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 10:55 bug#7579: cc-mode c++ template-typed variable decl regression Daniel Colascione
2010-12-07 13:17 ` Daniel Colascione
2012-02-14 14:14 ` Chong Yidong
2012-02-14 15:24 ` Alan Mackenzie
2012-02-14 16:11 ` Alan Mackenzie
2012-02-14 17:12 ` Andreas Schwab
2012-02-14 17:16 ` Daniel Colascione [this message]
2012-02-21 14:05 ` Alan Mackenzie
2016-02-04 19:09 ` Alan Mackenzie
2016-02-04 19:17 ` Daniel Colascione
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F3A96E9.8090507@dancol.org \
--to=dancol@dancol.org \
--cc=7579@debbugs.gnu.org \
--cc=acm@muc.de \
--cc=cyd@gnu.org \
--cc=dan.colascione@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).