GNU bug report logs - #7579
cc-mode c++ template-typed variable decl regression

Previous Next

Packages: cc-mode, emacs;

Reported by: Daniel Colascione <dan.colascione <at> gmail.com>

Date: Tue, 7 Dec 2010 10:54:02 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: Daniel Colascione <dancol <at> dancol.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 7579 <at> debbugs.gnu.org, Chong Yidong <cyd <at> gnu.org>, Daniel Colascione <dan.colascione <at> gmail.com>
Subject: bug#7579: cc-mode c++ template-typed variable decl regression
Date: Tue, 14 Feb 2012 09:16:25 -0800
[Message part 1 (text/plain, inline)]
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++.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 9 years and 105 days ago.

Previous Next


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