indent duplicate const

Bug #978952 reported by Marco on 2012-04-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
indent (Ubuntu)
Undecided
Unassigned

Bug Description

using GNU indent 2.2.11

file in test.cpp

void test::test () const
     {
     }

file out test.cpp after indent
void
test::test () const const
{
}

this is reported here
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=349065

for resolve change in handletoken.c

1452 if ((parser_state_tos->last_token == rparen) &&
1453 parser_state_tos->in_parameter_declaration &&
1454 parser_state_tos->saw_double_colon &&
1455 !strncmp (token, "const", 5))

to

1452 if ((parser_state_tos->last_token == rparen) &&
1453 parser_state_tos->in_parameter_declaration &&
1454 parser_state_tos->saw_double_colon &&
1455 (!strncmp (token, "const", 5)==0))

Marco (marcolikis) wrote :

Another bug...

original file:
void function () {
     DynamicPtr < Iterator < int > > iterator;
}

generate:

void function () {
     DynamicPtr < Iterator < int >>iterator;
}

Flags:
indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l100 -lp -npcs -nprs -npsl -sai -saf -saw -cs -nsc -sob -nfca -cp33 -ss -ut -il1 -brf

Marco (marcolikis) wrote :

DynamicPtr is a #define

Marco (marcolikis) wrote :

DynamicPtr is
#define auto_ptr

Marco (marcolikis) wrote :

in first call

    HashMap < SandboxControl * >&getSandboxControl() {
          return mapSandboxControl;
   } private:
       HashMap < SandboxControl * >mapSandboxControl;

in second call

    HashMap < SandboxControl * >&getSandboxControl() {
          return mapSandboxControl;
   }
   private:
       HashMap < SandboxControl * >mapSandboxControl;

in third call repet first...
in fourth call repet the second... ....

Marco (marcolikis) wrote :

the #4 in Header file

Andrej Shadura (andrew.sh) wrote :

This has been fixed upstream, but won’t be ported to this version.

Changed in indent (Ubuntu):
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers