https://bugs.llvm.org/show_bug.cgi?id=44006

            Bug ID: 44006
           Summary: clang-tidy modernize-concat-nested-namespaces and
                    llvm-namespace-comment together break file
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Tooling
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

compile_commands.json:

```
[
{
  "directory": "/",
  "command": "/usr/bin/clang++ -std=c++17 /a.cpp",
  "file": "/a.cpp"
}
]
```

a.cpp:

```
namespace outer {
namespace inner {
// here is some code
void f() {}
void g() {}
}
}
```

```
clang-tidy
"--checks=-*,modernize-concat-nested-namespaces,llvm-namespace-comment" --fix
a.cpp
```

a.cpp:

```
namespace outer::inner {
// here is some code
void f() {}
void g() {}
 // namespace inner} // namespace outer
```

The file no longer compiles. Expected output is:

```
namespace outer::inner {
// here is some code
void f() {}
void g() {}
} // namespace inner::outer
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to