This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/69029] New: [6 Regression] bogus -Wmisleading-indentation warning on one-line loops


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69029

            Bug ID: 69029
           Summary: [6 Regression] bogus -Wmisleading-indentation warning
                    on one-line loops
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

markus@x4 tmp % cat while.cpp
int main() {
  int i = 0;
  do i++; while (i < 3);
}

markus@x4 tmp % g++ -Wall -c while.cpp
while.cpp: In function âint main()â:
while.cpp:3:11: warning: statement is indented as if it were guarded by...
[-Wmisleading-indentation]
   do i++; while (i < 3);
           ^~~~~

while.cpp:3:3: note: ...this âdoâ clause, but it is not
   do i++; while (i < 3);
   ^~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]