[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-indent] Bug indent-2.2.9 C++ const method declaration [patch]
From: |
Jim McLaughlin |
Subject: |
[Bug-indent] Bug indent-2.2.9 C++ const method declaration [patch] |
Date: |
Fri, 27 May 2005 13:09:00 -0500 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050404) |
Hi,
We ran into the known bug in which a const c++ method signature has the
const tag duplicated by indent-2.2.9. For example:
// begin file
void foo::fn() const
{
cout << "Hello, World" << endl;
}
// end file
outputs the following
// begin file
void foo::fn() const const
{
cout << "Hello, World" << endl;
}
// end file
Looking through the code, we saw that the handle_token_decl function in
indent.c has a special case for ignoring the const in c++ method
signatures. This case skips the tag but does not advance the parse
stream to the next token. The attached patch sets token = token_end at
the end of the case, which resolved the problem. All the regression
tests ran fine.
Hope this helps,
Jim McLaughlin
--
/**
* Jim McLaughlin
* Director, Software Engineering
* Stonewater Control Systems
* http://www.stonewatercontrols.com
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-indent] Bug indent-2.2.9 C++ const method declaration [patch],
Jim McLaughlin <=